internal/lsp: modify check for a missing package
This change moves from marking a package with `go list` errors as missing, to marking a package with no files as missing. Change-Id: Ibad1e67518d8a7f4c4bde416c53ab8132ae534e3 Reviewed-on: https://go-review.googlesource.com/c/tools/+/184039 Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
parent
4e38253394
commit
55ee3a4131
|
@ -118,7 +118,8 @@ func (v *view) checkMetadata(ctx context.Context, f *goFile) (map[packageID]*met
|
|||
return nil, pkg.Errors, fmt.Errorf("package %s has errors, skipping type-checking", pkg.PkgPath)
|
||||
}
|
||||
for importPath, importPkg := range pkg.Imports {
|
||||
if len(importPkg.Errors) > 0 {
|
||||
// If we encounter a package we cannot import, mark it as missing.
|
||||
if len(importPkg.CompiledGoFiles) == 0 {
|
||||
if f.missingImports == nil {
|
||||
f.missingImports = make(map[packagePath]struct{})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue