diff --git a/internal/lsp/cache/load.go b/internal/lsp/cache/load.go index fad0ec9683..d70e091c85 100644 --- a/internal/lsp/cache/load.go +++ b/internal/lsp/cache/load.go @@ -136,6 +136,9 @@ func (v *view) checkMetadata(ctx context.Context, f *goFile, fh source.FileHandl // determine if they have changed. // It assumes that the caller holds the lock on the f.mu lock. func (v *view) shouldRunGopackages(ctx context.Context, f *goFile, file *ast.File, metadata []*metadata) bool { + f.mu.Lock() + defer f.mu.Unlock() + // Check if the package's name has changed, by checking if this is a filename // we already know about, and if so, check if its package name has changed. for _, m := range metadata { diff --git a/internal/lsp/source/completion_literal.go b/internal/lsp/source/completion_literal.go index 4769b0fe50..c8dbafb1bc 100644 --- a/internal/lsp/source/completion_literal.go +++ b/internal/lsp/source/completion_literal.go @@ -284,7 +284,7 @@ func (c *completer) basicLiteral(T types.Type, typeName string, matchScore float InsertText: nonSnippet, Detail: T.String(), Score: matchScore * literalCandidateScore, - Kind: VariableCompletionItem, + Kind: protocol.VariableCompletion, snippet: snip, }) }