-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/telemetry-wins
Milestone
Description
#!stacks
"bug.Errorf" && "cache.(*action).exec.func2:+48"
Issue created by stacks.
if mapper == nil {
// The start position was not among the package's parsed
// Go files, indicating that the analyzer added new files
// to the FileSet.
//
// For example, the cgocall analyzer re-parses and
// type-checks some of the files in a special environment;
// and asmdecl and other low-level runtime analyzers call
// ReadFile to parse non-Go files.
// (This is a supported feature, documented at go/analysis.)
//
// In principle these files could be:
//
// - OtherFiles (non-Go files such as asm).
// However, we set Pass.OtherFiles=[] because
// gopls won't service "diagnose" requests
// for non-Go files, so there's no point
// reporting diagnostics in them.
//
// - IgnoredFiles (files tagged for other configs).
// However, we set Pass.IgnoredFiles=[] because,
// in most cases, zero-config gopls should create
// another view that covers these files.
//
// - Referents of //line directives, as in cgo packages.
// The file names in this case are not known a priori.
// gopls generally tries to avoid honoring line directives,
// but analyzers such as cgocall may honor them.
//
// In short, it's unclear how this can be reached
// other than due to an analyzer bug.
return protocol.Location{}, bug.Errorf("diagnostic location is not among files of package: %s", tokFile.Name())
}
The analyzer that reported the diagnostic is staticcheck's SA4023, but all its calls to Report look fine.
This stack dlmz3w
was reported by telemetry:
gopls/bug
golang.org/x/tools/gopls/internal/util/bug.report:+35
golang.org/x/tools/gopls/internal/util/bug.Errorf:+2
golang.org/x/tools/gopls/internal/cache.(*action).exec.func2:+48
golang.org/x/tools/gopls/internal/cache.toGobDiagnostic:+22
golang.org/x/tools/gopls/internal/cache.(*action).exec.func3:+1
honnef.co/go/tools/analysis/report.Report:+40
honnef.co/go/tools/staticcheck/sa4023.run:+100
golang.org/x/tools/gopls/internal/cache.(*action).exec.func7:+31
golang.org/x/tools/gopls/internal/cache.(*action).exec:+277
golang.org/x/tools/gopls/internal/cache.execActions.func1.1:+2
sync.(*Once).doSlow:+5
sync.(*Once).Do:=67
golang.org/x/tools/gopls/internal/cache.execActions.func1:+2
runtime.goexit:+0
golang.org/x/tools/[email protected] go1.23.2 linux/amd64 vscode (1)
Dups: ARI9LQ xuqd0A UM4FBg
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/telemetry-wins