mirror of
https://github.com/golang/go
synced 2024-11-18 18:44:42 -07: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:
parent
51295c7ec1
commit
a2c791aa64
4
internal/lsp/cache/view.go
vendored
4
internal/lsp/cache/view.go
vendored
@ -104,7 +104,11 @@ func (v *View) parse(uri source.URI) error {
|
|||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, pkg := range pkgs {
|
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.
|
// Add every file in this package to our cache.
|
||||||
for _, fAST := range pkg.Syntax {
|
for _, fAST := range pkg.Syntax {
|
||||||
// TODO: If a file is in multiple packages, which package do we store?
|
// TODO: If a file is in multiple packages, which package do we store?
|
||||||
|
Loading…
Reference in New Issue
Block a user