mirror of
https://github.com/golang/go
synced 2024-11-18 20:44:45 -07:00
internal/lsp: fix check for changed imports
We weren't comparing the right values when checking to see if a file's import statements had changed. This was causing us to not refetch a package's metadata when needed in certain cases. In particular, if you typed out an import path by hand you would get stuck with "no metadata for package" until you added or deleted another import line to trigger metadata refresh. Updates golang/go#32516, golang/go#32232 Change-Id: I1c99e9ee56d18f02c44c749d33679aa4e561c620 GitHub-Last-Rev: 20d46b30b520572b05e3228d9e43ba46dfd1be3d GitHub-Pull-Request: golang/tools#112 Reviewed-on: https://go-review.googlesource.com/c/tools/+/181578 Reviewed-by: Rebecca Stambler <rstambler@golang.org> Run-TryBot: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
parent
f8d1dee965
commit
4bfb4c74ac
2
internal/lsp/cache/load.go
vendored
2
internal/lsp/cache/load.go
vendored
@ -130,7 +130,7 @@ func (v *view) parseImports(ctx context.Context, f *goFile) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
for i, importSpec := range f.imports {
|
for i, importSpec := range f.imports {
|
||||||
if importSpec.Path.Value != f.imports[i].Path.Value {
|
if importSpec.Path.Value != parsed.Imports[i].Path.Value {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user