1
0
mirror of https://github.com/golang/go synced 2024-09-30 22:48:32 -06:00

internal/lsp/cache: return error when no packages found

Change-Id: Ia11f0c428cffdd42eab5c4322e9ff6f0a38870fc
Reviewed-on: https://go-review.googlesource.com/c/156777
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Yasuhiro Matsumoto 2019-01-08 12:56:24 +09:00 committed by Rebecca Stambler
parent 51295c7ec1
commit a2c791aa64

View File

@ -104,7 +104,11 @@ func (v *View) parse(uri source.URI) error {
}
return err
}
for _, pkg := range pkgs {
if len(pkg.Syntax) == 0 {
return fmt.Errorf("no syntax trees for %s", pkg.PkgPath)
}
// Add every file in this package to our cache.
for _, fAST := range pkg.Syntax {
// TODO: If a file is in multiple packages, which package do we store?