Skip to content

x/tools/gopls/internal/cmd/stacks: linkify positions in stack output #68748

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

Closed
findleyr opened this issue Aug 6, 2024 · 2 comments
Closed

x/tools/gopls/internal/cmd/stacks: linkify positions in stack output #68748

findleyr opened this issue Aug 6, 2024 · 2 comments
Labels
gabywins gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Member

findleyr commented Aug 6, 2024

When we run the stacks command to extract information from recent stacks, it would be extremely useful to associate stack information with source links to go.googlesource.com or cs.opensource.google.

In order to do so, we'd need to:

  1. For each stack program, check out the repo for that program at the correct version (for now, we can hard-code a list of program repos, but eventually we can also use origin information from the proxy (e.g., for gopls.
  2. Use go/packages to load package information for the stack using the correct GOOS/GOARCH combination corresponding to the report.
  3. Look up symbols in in the package, and translate line offsets in function bodies to absolute line positions.
  4. Update the output of the stacks command to support html output, so that we can format nicely linkified stack information (perhaps an -html flag can generate an html summary which can be opened in the browser? I'm not sure here how best to serve the information.

For now, the stacks command is the most appropriate place to implement this logic, but one can imagine that it could also be useful as integration with e.g. gaby, or telemetry.go.dev.

CC @adonovan @h9jiang @golang/telemetry

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Aug 6, 2024
@gopherbot gopherbot added this to the Unreleased milestone Aug 6, 2024
@gabyhelp
Copy link

gabyhelp commented Aug 6, 2024

Related Issues and Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@findleyr
Copy link
Member Author

findleyr commented Aug 6, 2024

Aha, complete dupe. Perhaps I didn't find it because it wasn't part of the telemetry project or labeled with telemetry.

Perhaps gaby should suggest labels and projects.

@findleyr findleyr closed this as not planned Won't fix, can't repro, duplicate, stale Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gabywins gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants