Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls/internal/telemetry/cmd/stacks: incorrect line number in codesearch link #71660

Open
adonovan opened this issue Feb 11, 2025 · 2 comments
Assignees
Labels
telemetry x/telemetry issues ToolProposal Issues describing a requested change to a Go tool or command-line program.
Milestone

Comments

@adonovan
Copy link
Member

In #71659 (comment), there is the following stack frame:

The symbol name refers to line 3 of the Report closure, i.e. the "invalid SuggestedFixes" bug report, but the link target is in the middle of a comment.

		Report: func(d analysis.Diagnostic) {
			// Assert that SuggestedFixes are well formed.
			if err := analysisinternal.ValidateFixes(apkg.pkg.FileSet(), analyzer, d.SuggestedFixes); err != nil {
				bug.Reportf("invalid SuggestedFixes: %v", err)         <---- correct location
				d.SuggestedFixes = nil
			}
			diagnostic, err := toGobDiagnostic(posToLocation, analyzer, d)
			if err != nil {
				// Don't bug.Report here: these errors all originate in
				// posToLocation, and we can more accurately discriminate
				// severe errors from benign ones in that function.             <------ actual link target
				event.Error(ctx, fmt.Sprintf("internal error converting diagnostic from analyzer %q", analyzer.Name), err)
				return
			}
			diagnostics = append(diagnostics, diagnostic)
		},
@adonovan adonovan added telemetry x/telemetry issues gopls/telemetry issues that would benefit from telemetry data and removed gopls/telemetry issues that would benefit from telemetry data labels Feb 11, 2025
@gopherbot gopherbot added this to the Unreleased milestone Feb 11, 2025
@gabyhelp gabyhelp added the ToolProposal Issues describing a requested change to a Go tool or command-line program. label Feb 11, 2025
@prattmic
Copy link
Member

In v0.17.1, line 1143 was the third line of cache.(*action).exec.func3 (but is not a call to Reportf). Did stacks fetch the wrong version of the source?

https://cs.opensource.google/go/x/tools/+/refs/tags/gopls/v0.17.1:gopls/internal/cache/analysis.go;l=1143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
telemetry x/telemetry issues ToolProposal Issues describing a requested change to a Go tool or command-line program.
Projects
None yet
Development

No branches or pull requests

4 participants