mirror of
https://github.com/golang/go
synced 2024-11-18 16:54:43 -07:00
internal/lsp: fix merge conflict and race condition
Race condition: I deleted the code that acquired the mutex when checking if a file's imports have changed. Merge conflict: I submitted a change without rebasing and re-running TryBots. Change-Id: Iae351f2fff893cfd94db79d9f79578d9827a8c21 Reviewed-on: https://go-review.googlesource.com/c/tools/+/197297 Run-TryBot: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
parent
9c4a82ab32
commit
125cfdbd7b
3
internal/lsp/cache/load.go
vendored
3
internal/lsp/cache/load.go
vendored
@ -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 {
|
||||
|
@ -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,
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user