[tools] gopls/internal/golang: implement type definition for builtin types

0 views
Skip to first unread message

Madeline Kalil (Gerrit)

unread,
Dec 16, 2025, 2:58:13 PM (13 hours ago) Dec 16
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Hongxiang Jiang, Go LUCI, Alan Donovan, golang-co...@googlegroups.com

Madeline Kalil submitted the change

Change information

Commit message:
gopls/internal/golang: implement type definition for builtin types

Currently, type definition queries on builtin types such as int
and bool return no results.
Meanwhile, type definition queries on the builtin "error" return
the same location as a normal definition query - its
fake declaration in {builtin,unsafe}.go.
We should make this behavior consistent across all builtin types
by returning the source declaration for both definition and type
definition queries.
Change-Id: Ifb3cea6bd679b6d445afa5caa62799a6bc88160b
Reviewed-by: Hongxiang Jiang <hxj...@golang.org>
Files:
  • M gopls/internal/golang/identifier.go
  • M gopls/internal/golang/type_definition.go
  • M gopls/internal/test/marker/doc.go
  • M gopls/internal/test/marker/testdata/typedef/typedef.txt
Change size: S
Delta: 4 files changed, 25 insertions(+), 15 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Hongxiang Jiang
  • 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: Ifb3cea6bd679b6d445afa5caa62799a6bc88160b
Gerrit-Change-Number: 729740
Gerrit-PatchSet: 5
Gerrit-Owner: Madeline Kalil <mka...@google.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Hongxiang Jiang <hxj...@golang.org>
Gerrit-Reviewer: Madeline Kalil <mka...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages