diff --git a/internal/lsp/cache/file.go b/internal/lsp/cache/file.go index bd8fb054..14bb7f54 100644 --- a/internal/lsp/cache/file.go +++ b/internal/lsp/cache/file.go @@ -89,6 +89,7 @@ func (f *goFile) GetToken(ctx context.Context) *token.File { defer f.view.mu.Unlock() if f.token == nil || len(f.view.contentChanges) > 0 { if _, err := f.view.parse(ctx, f); err != nil { + f.View().Session().Logger().Errorf(ctx, "unable to check package for %s: %v", f.URI(), err) return nil } } @@ -101,6 +102,7 @@ func (f *goFile) GetAST(ctx context.Context) *ast.File { if f.ast == nil || len(f.view.contentChanges) > 0 { if _, err := f.view.parse(ctx, f); err != nil { + f.View().Session().Logger().Errorf(ctx, "unable to check package for %s: %v", f.URI(), err) return nil } } @@ -113,6 +115,8 @@ func (f *goFile) GetPackage(ctx context.Context) source.Package { if f.pkg == nil || len(f.view.contentChanges) > 0 { if errs, err := f.view.parse(ctx, f); err != nil { + f.View().Session().Logger().Errorf(ctx, "unable to check package for %s: %v", f.URI(), err) + // Create diagnostics for errors if we are able to. if len(errs) > 0 { return &pkg{errors: errs} diff --git a/internal/lsp/info.1.11.go b/internal/lsp/info.1.11.go index cd243393..ac4128f0 100644 --- a/internal/lsp/info.1.11.go +++ b/internal/lsp/info.1.11.go @@ -12,5 +12,5 @@ import ( ) func printBuildInfo(w io.Writer, verbose bool) { - fmt.Fprintf(w, "no module information, gopls not build with go 1.11 or earlier\n") + fmt.Fprintf(w, "no module information, gopls not built with go 1.11 or earlier\n") }