Skip to content

x/tools/gopls: find reference doesn't reported all references of usages #73762

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

Open
xieyuschen opened this issue May 18, 2025 · 2 comments
Open
Labels
BugReport Issues describing a possible bug in the Go implementation. 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

@xieyuschen
Copy link
Member

gopls version

v0.18.1

go env

irrelevant

What did you do?

  • Click Preorder of func (c Cursor) Preorder(types ...ast.Node) iter.Seq[Cursor] inside file $tools/go/ast/inspector/cursor.go.

  • right client at Preorder, and then select Find All Reference.

What did you see happen?

$tools/gopls/internal/analysis/modernize/minmax.go has use this method inside for curIfStmt := range curFile.Preorder((*ast.IfStmt)(nil)) {. But gopls doesn't report this usage.

Image

Image

What did you expect to see?

I expected gopls reports its usage. I suspect it's the issue that the gopls isn't the same module of tools.

So the question might be: is it better to report references for submodules as well, if current project contains a root module and multiple modules? And is it possible to do so?

Editor and settings

No response

Logs

No response

@xieyuschen xieyuschen added gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. labels May 18, 2025
@gopherbot gopherbot added this to the Unreleased milestone May 18, 2025
@EXELANCE-LLC
Copy link

❤️

@gabyhelp
Copy link

Related Issues

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

@gabyhelp gabyhelp added the BugReport Issues describing a possible bug in the Go implementation. label May 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugReport Issues describing a possible bug in the Go implementation. 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

4 participants