[tools] gopls/internal/mcp: add a variant of the references tool

1 view
Skip to first unread message

Robert Findley (Gerrit)

unread,
Jul 8, 2025, 12:51:54 PMJul 8
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Madeline Kalil, Go LUCI, Hongxiang Jiang, golang-co...@googlegroups.com

Robert Findley submitted the change

Change information

Commit message:
gopls/internal/mcp: add a variant of the references tool

Add a variant of the 'references' tool that accepts a (possibly
qualified) symbol name, rather than a location.

The hope is that LLMs may find this easier to use, since they don't have
to populate a location.

For golang/go#73580
Change-Id: Ib47bcdc290e3bc7c5c822f25e9aedab2311e12ac
Reviewed-by: Madeline Kalil <mka...@google.com>
Files:
  • M gopls/internal/golang/call_hierarchy.go
  • M gopls/internal/golang/comment.go
  • M gopls/internal/golang/definition.go
  • M gopls/internal/golang/type_definition.go
  • M gopls/internal/golang/type_hierarchy.go
  • M gopls/internal/mcp/mcp.go
  • M gopls/internal/mcp/references.go
  • A gopls/internal/mcp/symbol_references.go
  • A gopls/internal/test/marker/testdata/mcptools/symbol_references.txt
Change size: L
Delta: 9 files changed, 240 insertions(+), 11 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Madeline Kalil
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: Ib47bcdc290e3bc7c5c822f25e9aedab2311e12ac
Gerrit-Change-Number: 686275
Gerrit-PatchSet: 5
Gerrit-Owner: Robert Findley <rfin...@google.com>
Gerrit-Reviewer: Hongxiang Jiang <hxj...@golang.org>
Gerrit-Reviewer: Madeline Kalil <mka...@google.com>
Gerrit-Reviewer: Robert Findley <rfin...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages