diff --git a/internal/lsp/cache/view.go b/internal/lsp/cache/view.go index 812fa1da..aff5988c 100644 --- a/internal/lsp/cache/view.go +++ b/internal/lsp/cache/view.go @@ -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?