[tools] gopls: improve doc link matching to support links followed by a colon

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
Apr 9, 2026, 4:20:36 PM (11 hours ago) Apr 9
to Runqian Chen, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Madeline Kalil, Go LUCI, Alan Donovan, golang-co...@googlegroups.com

Gopher Robot submitted the change

Change information

Commit message:
gopls: improve doc link matching to support links followed by a colon

The existing `docLinkRegex` fails to handle cases like `[Demo]: demo`,
which are valid. This change introduces a new helper function,
`findDocLinkIndices`, to correctly locate doc link indices. In the mean
time, changing the `docLinkRegex` to find out all the matched positions.

Fixes golang/go#75925
Change-Id: I359990d9c71c73bad5869c280af74dd301f96338
Reviewed-by: Madeline Kalil <mka...@google.com>
Reviewed-by: Alan Donovan <adon...@google.com>
Auto-Submit: Alan Donovan <adon...@google.com>
Files:
  • M gopls/internal/golang/comment.go
  • M gopls/internal/golang/semtok.go
  • A gopls/internal/test/marker/testdata/token/issue75925.txt
Change size: M
Delta: 3 files changed, 60 insertions(+), 4 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Alan Donovan, +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: I359990d9c71c73bad5869c280af74dd301f96338
Gerrit-Change-Number: 715240
Gerrit-PatchSet: 4
Gerrit-Owner: Runqian Chen <runqian...@gmail.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Madeline Kalil <mka...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages