[tools] gopls: add shadowed semantic token modifier

4 views
Skip to first unread message

Mateusz Poliwczak (Gerrit)

unread,
Sep 10, 2025, 2:55:16 PM9/10/25
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Mateusz Poliwczak has uploaded the change for review

Commit message

gopls: add shadowed semantic token modifier

Fixes #75368
Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb

Change diff

diff --git a/gopls/internal/golang/semtok.go b/gopls/internal/golang/semtok.go
index f0286ff..674b2cf 100644
--- a/gopls/internal/golang/semtok.go
+++ b/gopls/internal/golang/semtok.go
@@ -622,6 +622,14 @@
mods = append(mods, semtok.ModDefinition)
tok, mods = tv.appendObjectModifiers(mods, obj)

+ // obj.Parent.Parent is the surrounding scope. If we can find another declaration
+ // starting from there, we have a shadowed identifier.
+ if obj.Parent().Parent() != nil {
+ _, shadowed := obj.Parent().Parent().LookupParent(id.Name, id.Pos())
+ if shadowed != nil {
+ mods = append(mods, semtok.ModShadowed)
+ }
+ }
} else if obj, ok = tv.info.Uses[id]; ok {
// use
tok, mods = tv.appendObjectModifiers(mods, obj)
diff --git a/gopls/internal/protocol/semtok/semtok.go b/gopls/internal/protocol/semtok/semtok.go
index 9922839..e38acae 100644
--- a/gopls/internal/protocol/semtok/semtok.go
+++ b/gopls/internal/protocol/semtok/semtok.go
@@ -5,7 +5,9 @@
// The semtok package provides an encoder for LSP's semantic tokens.
package semtok

-import "sort"
+import (
+ "sort"
+)

// A Token provides the extent and semantics of a token.
type Token struct {
@@ -111,6 +113,8 @@
ModSlice Modifier = "slice"
ModString Modifier = "string"
ModStruct Modifier = "struct"
+
+ ModShadowed Modifier = "shadowed" // shadowed identifiers e.g. variable
)

// TokenModifiers is a slice of modifiers gopls will return as its server
@@ -133,6 +137,8 @@
ModSlice,
ModString,
ModStruct,
+
+ ModShadowed,
}

// Encode returns the LSP encoding of a sequence of tokens.

Change information

Files:
  • M gopls/internal/golang/semtok.go
  • M gopls/internal/protocol/semtok/semtok.go
Change size: S
Delta: 2 files changed, 15 insertions(+), 1 deletion(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
Gerrit-Change-Number: 702555
Gerrit-PatchSet: 1
Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Mateusz Poliwczak (Gerrit)

unread,
Apr 6, 2026, 1:01:52 PM (3 days ago) Apr 6
to goph...@pubsubhelper.golang.org, Go LUCI, Alan Donovan, golang-co...@googlegroups.com
Attention needed from Alan Donovan

Mateusz Poliwczak voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Alan Donovan
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: tools
    Gerrit-Branch: master
    Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
    Gerrit-Change-Number: 702555
    Gerrit-PatchSet: 17
    Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
    Gerrit-Reviewer: Alan Donovan <adon...@google.com>
    Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
    Gerrit-Attention: Alan Donovan <adon...@google.com>
    Gerrit-Comment-Date: Mon, 06 Apr 2026 17:01:46 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    unsatisfied_requirement
    open
    diffy

    Mateusz Poliwczak (Gerrit)

    unread,
    Apr 6, 2026, 1:02:28 PM (3 days ago) Apr 6
    to goph...@pubsubhelper.golang.org, Go LUCI, Alan Donovan, golang-co...@googlegroups.com
    Attention needed from Alan Donovan

    Mateusz Poliwczak added 3 comments

    Patchset-level comments
    File-level comment, Patchset 17 (Latest):
    Mateusz Poliwczak . resolved

    I think this CL is ready for review.

    File gopls/internal/golang/semtok.go
    Line 125, Patchset 7: names := s.Names()
    Mateusz Poliwczak . resolved

    This is potentially expensive, as it allocates + sorts. But there is no better alternative (maybe there is a proposal already for some new API that would be better in terms of perf?).

    Alan Donovan

    (see L128)

    Mateusz Poliwczak

    Acknowledged

    Line 128, Patchset 9: tv.shadowing[s.Lookup(name)] = struct{}{}
    Mateusz Poliwczak . resolved

    TODO: position is also important

    Alan Donovan

    Indeed. Rather than allocate a fully populated map, why not just call scope.LookupParent for each identifier encountered? This computes the correct answer at a given position. Then measure, then optimize.

    Mateusz Poliwczak

    Ok, so the perf looks like this:

    ```
    goos: linux
    goarch: amd64
    pkg: golang.org/x/tools/gopls/internal/test/integration/bench
    cpu: 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    │ /tmp/before │ /tmp/after │
    │ sec/op │ sec/op vs base │
    SemanticTokens-8 10.30m ± 2% 10.23m ± 1% ~ (p=0.307 n=25)
                     │ /tmp/before  │             /tmp/after              │
    │ B/op │ B/op vs base │
    SemanticTokens-8 2.709Mi ± 0% 2.712Mi ± 0% +0.10% (p=0.000 n=25)
                     │ /tmp/before │             /tmp/after             │
    │ allocs/op │ allocs/op vs base │
    SemanticTokens-8 13.90k ± 0% 13.94k ± 0% +0.30% (p=0.000 n=25)
    ```

    There is basically no change. I think we are good here with this approach, will work on more tests now.

    Alan Donovan

    That's promising. How does an unmemoized LookupParent compare? Let's start with correct code and then optimize.

    Mateusz Poliwczak

    That's promising. How does an unmemoized LookupParent compare? Let's start with correct code and then optimize.

    Oh sorry I should have mentioned that, that benchmark is with the unmemoized LookupParent approach (as in the latest patchset).

    Alan Donovan

    Great!

    Mateusz Poliwczak

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alan Donovan
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: tools
      Gerrit-Branch: master
      Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
      Gerrit-Change-Number: 702555
      Gerrit-PatchSet: 17
      Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
      Gerrit-Reviewer: Alan Donovan <adon...@google.com>
      Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
      Gerrit-Attention: Alan Donovan <adon...@google.com>
      Gerrit-Comment-Date: Mon, 06 Apr 2026 17:02:22 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Mateusz Poliwczak <mpoliw...@gmail.com>
      Comment-In-Reply-To: Alan Donovan <adon...@google.com>
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Mateusz Poliwczak (Gerrit)

      unread,
      Apr 6, 2026, 1:06:37 PM (3 days ago) Apr 6
      to goph...@pubsubhelper.golang.org, Go LUCI, Alan Donovan, golang-co...@googlegroups.com
      Attention needed from Alan Donovan

      Mateusz Poliwczak added 1 comment

      File gopls/doc/features/passive.md
      Line 261, Patchset 17 (Latest):- `"shadowing"`
      Mateusz Poliwczak . unresolved

      Oh, also need to do this.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Alan Donovan
      Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: tools
        Gerrit-Branch: master
        Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
        Gerrit-Change-Number: 702555
        Gerrit-PatchSet: 17
        Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
        Gerrit-Reviewer: Alan Donovan <adon...@google.com>
        Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
        Gerrit-Attention: Alan Donovan <adon...@google.com>
        Gerrit-Comment-Date: Mon, 06 Apr 2026 17:06:30 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        unsatisfied_requirement
        open
        diffy

        Mateusz Poliwczak (Gerrit)

        unread,
        Apr 6, 2026, 1:13:17 PM (3 days ago) Apr 6
        to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
        Attention needed from Alan Donovan and Mateusz Poliwczak

        Mateusz Poliwczak uploaded new patchset

        Mateusz Poliwczak uploaded patch set #18 to this change.
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alan Donovan
        • Mateusz Poliwczak
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: newpatchset
        Gerrit-Project: tools
        Gerrit-Branch: master
        Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
        Gerrit-Change-Number: 702555
        Gerrit-PatchSet: 18
        Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
        Gerrit-Reviewer: Alan Donovan <adon...@google.com>
        Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
        Gerrit-Attention: Mateusz Poliwczak <mpoliw...@gmail.com>
        Gerrit-Attention: Alan Donovan <adon...@google.com>
        unsatisfied_requirement
        open
        diffy

        Mateusz Poliwczak (Gerrit)

        unread,
        Apr 6, 2026, 1:13:28 PM (3 days ago) Apr 6
        to goph...@pubsubhelper.golang.org, Go LUCI, Alan Donovan, golang-co...@googlegroups.com
        Attention needed from Alan Donovan

        Mateusz Poliwczak voted and added 1 comment

        Votes added by Mateusz Poliwczak

        Commit-Queue+1

        1 comment

        File gopls/doc/features/passive.md
        Line 261, Patchset 17:- `"shadowing"`
        Mateusz Poliwczak . resolved

        Oh, also need to do this.

        Mateusz Poliwczak

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Alan Donovan
        Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: tools
          Gerrit-Branch: master
          Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
          Gerrit-Change-Number: 702555
          Gerrit-PatchSet: 18
          Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
          Gerrit-Reviewer: Alan Donovan <adon...@google.com>
          Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
          Gerrit-Attention: Alan Donovan <adon...@google.com>
          Gerrit-Comment-Date: Mon, 06 Apr 2026 17:13:23 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Mateusz Poliwczak <mpoliw...@gmail.com>
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Mateusz Poliwczak (Gerrit)

          unread,
          Apr 6, 2026, 1:14:21 PM (3 days ago) Apr 6
          to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
          Attention needed from Alan Donovan and Mateusz Poliwczak

          Mateusz Poliwczak uploaded new patchset

          Mateusz Poliwczak uploaded patch set #19 to this change.
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alan Donovan
          • Mateusz Poliwczak
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: newpatchset
          Gerrit-Project: tools
          Gerrit-Branch: master
          Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
          Gerrit-Change-Number: 702555
          Gerrit-PatchSet: 19
          Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
          Gerrit-Reviewer: Alan Donovan <adon...@google.com>
          Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
          Gerrit-Attention: Mateusz Poliwczak <mpoliw...@gmail.com>
          Gerrit-Attention: Alan Donovan <adon...@google.com>
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Mateusz Poliwczak (Gerrit)

          unread,
          Apr 6, 2026, 1:14:39 PM (3 days ago) Apr 6
          to goph...@pubsubhelper.golang.org, Go LUCI, Alan Donovan, golang-co...@googlegroups.com
          Attention needed from Alan Donovan

          Mateusz Poliwczak voted Commit-Queue+1

          Commit-Queue+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alan Donovan
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: tools
          Gerrit-Branch: master
          Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
          Gerrit-Change-Number: 702555
          Gerrit-PatchSet: 19
          Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
          Gerrit-Reviewer: Alan Donovan <adon...@google.com>
          Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
          Gerrit-Attention: Alan Donovan <adon...@google.com>
          Gerrit-Comment-Date: Mon, 06 Apr 2026 17:14:33 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Mateusz Poliwczak (Gerrit)

          unread,
          Apr 6, 2026, 1:56:06 PM (3 days ago) Apr 6
          to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
          Attention needed from Alan Donovan

          Mateusz Poliwczak uploaded new patchset

          Mateusz Poliwczak uploaded patch set #20 to this change.
          Following approvals got outdated and were removed:
          • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alan Donovan
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: newpatchset
          Gerrit-Project: tools
          Gerrit-Branch: master
          Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
          Gerrit-Change-Number: 702555
          Gerrit-PatchSet: 20
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Mateusz Poliwczak (Gerrit)

          unread,
          Apr 6, 2026, 1:56:27 PM (3 days ago) Apr 6
          to goph...@pubsubhelper.golang.org, Go LUCI, Alan Donovan, golang-co...@googlegroups.com
          Attention needed from Alan Donovan

          Mateusz Poliwczak voted Commit-Queue+1

          Commit-Queue+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alan Donovan
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: tools
          Gerrit-Branch: master
          Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
          Gerrit-Change-Number: 702555
          Gerrit-PatchSet: 20
          Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
          Gerrit-Reviewer: Alan Donovan <adon...@google.com>
          Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
          Gerrit-Attention: Alan Donovan <adon...@google.com>
          Gerrit-Comment-Date: Mon, 06 Apr 2026 17:56:19 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Mateusz Poliwczak (Gerrit)

          unread,
          Apr 6, 2026, 2:53:45 PM (2 days ago) Apr 6
          to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
          Attention needed from Alan Donovan

          Mateusz Poliwczak uploaded new patchset

          Mateusz Poliwczak uploaded patch set #21 to this change.
          Following approvals got outdated and were removed:
          • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alan Donovan
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: newpatchset
          Gerrit-Project: tools
          Gerrit-Branch: master
          Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
          Gerrit-Change-Number: 702555
          Gerrit-PatchSet: 21
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Mateusz Poliwczak (Gerrit)

          unread,
          Apr 6, 2026, 2:53:55 PM (2 days ago) Apr 6
          to goph...@pubsubhelper.golang.org, Go LUCI, Alan Donovan, golang-co...@googlegroups.com
          Attention needed from Alan Donovan

          Mateusz Poliwczak voted Commit-Queue+1

          Commit-Queue+1
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Alan Donovan
          Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: tools
          Gerrit-Branch: master
          Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
          Gerrit-Change-Number: 702555
          Gerrit-PatchSet: 21
          Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
          Gerrit-Reviewer: Alan Donovan <adon...@google.com>
          Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
          Gerrit-Attention: Alan Donovan <adon...@google.com>
          Gerrit-Comment-Date: Mon, 06 Apr 2026 18:53:50 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          unsatisfied_requirement
          satisfied_requirement
          open
          diffy

          Alan Donovan (Gerrit)

          unread,
          Apr 6, 2026, 4:03:24 PM (2 days ago) Apr 6
          to Mateusz Poliwczak, goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com
          Attention needed from Mateusz Poliwczak

          Alan Donovan added 3 comments

          File gopls/doc/features/passive.md
          Line 260, Patchset 21 (Latest):and a non-standard `"shadowing"` modifier that marks declarations
          Alan Donovan . unresolved

          each identifier that refers to a symbol that shadows an existing symbol...

          Line 262, Patchset 21 (Latest):
          Alan Donovan . unresolved

          Join paragraphs.

          Line 266, Patchset 21 (Latest):For example, in Neovim, such declarations can be highlighted with
          bold and underline, with:

          ```lua
          vim.api.nvim_set_hl(0, '@lsp.mod.shadowing', { bold = true, underline = true })
          ```
          Alan Donovan . unresolved

          This information doesn't really belong here. We don't have a great solution for where editor-specific information should live, but I'm inclined toward moving it all out of the primary docs and into the editor/ directory.

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Mateusz Poliwczak
          Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: tools
            Gerrit-Branch: master
            Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
            Gerrit-Change-Number: 702555
            Gerrit-PatchSet: 21
            Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
            Gerrit-Reviewer: Alan Donovan <adon...@google.com>
            Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
            Gerrit-Attention: Mateusz Poliwczak <mpoliw...@gmail.com>
            Gerrit-Comment-Date: Mon, 06 Apr 2026 20:03:21 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            unsatisfied_requirement
            satisfied_requirement
            open
            diffy

            Mateusz Poliwczak (Gerrit)

            unread,
            Apr 7, 2026, 2:16:09 PM (2 days ago) Apr 7
            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Mateusz Poliwczak

            Mateusz Poliwczak uploaded new patchset

            Mateusz Poliwczak uploaded patch set #22 to this change.
            Following approvals got outdated and were removed:
            • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI

            Related details

            Attention is currently required from:
            • Mateusz Poliwczak
            Submit Requirements:
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              • requirement is not satisfiedTryBots-Pass
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: newpatchset
              Gerrit-Project: tools
              Gerrit-Branch: master
              Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
              Gerrit-Change-Number: 702555
              Gerrit-PatchSet: 22
              unsatisfied_requirement
              open
              diffy

              Mateusz Poliwczak (Gerrit)

              unread,
              Apr 7, 2026, 2:16:17 PM (2 days ago) Apr 7
              to goph...@pubsubhelper.golang.org, Go LUCI, Alan Donovan, golang-co...@googlegroups.com
              Attention needed from Alan Donovan

              Mateusz Poliwczak voted and added 3 comments

              Votes added by Mateusz Poliwczak

              Commit-Queue+1

              3 comments

              File gopls/doc/features/passive.md
              Line 260, Patchset 21:and a non-standard `"shadowing"` modifier that marks declarations
              Alan Donovan . resolved

              each identifier that refers to a symbol that shadows an existing symbol...

              Mateusz Poliwczak

              Done

              Line 262, Patchset 21:
              Alan Donovan . resolved

              Join paragraphs.

              Mateusz Poliwczak

              Done

              Line 266, Patchset 21:For example, in Neovim, such declarations can be highlighted with

              bold and underline, with:

              ```lua
              vim.api.nvim_set_hl(0, '@lsp.mod.shadowing', { bold = true, underline = true })
              ```
              Alan Donovan . resolved

              This information doesn't really belong here. We don't have a great solution for where editor-specific information should live, but I'm inclined toward moving it all out of the primary docs and into the editor/ directory.

              Mateusz Poliwczak

              Done

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Alan Donovan
              Submit Requirements:
                • requirement is not satisfiedCode-Review
                • requirement satisfiedNo-Unresolved-Comments
                • requirement is not satisfiedReview-Enforcement
                • requirement is not satisfiedTryBots-Pass
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: tools
                Gerrit-Branch: master
                Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
                Gerrit-Change-Number: 702555
                Gerrit-PatchSet: 22
                Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
                Gerrit-Reviewer: Alan Donovan <adon...@google.com>
                Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
                Gerrit-Attention: Alan Donovan <adon...@google.com>
                Gerrit-Comment-Date: Tue, 07 Apr 2026 18:16:10 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: Yes
                Comment-In-Reply-To: Alan Donovan <adon...@google.com>
                unsatisfied_requirement
                satisfied_requirement
                open
                diffy

                Mateusz Poliwczak (Gerrit)

                unread,
                Apr 7, 2026, 2:16:44 PM (2 days ago) Apr 7
                to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                Attention needed from Alan Donovan and Mateusz Poliwczak

                Mateusz Poliwczak uploaded new patchset

                Mateusz Poliwczak uploaded patch set #23 to this change.
                Open in Gerrit

                Related details

                Attention is currently required from:
                • Alan Donovan
                • Mateusz Poliwczak
                Submit Requirements:
                • requirement is not satisfiedCode-Review
                • requirement satisfiedNo-Unresolved-Comments
                • requirement is not satisfiedReview-Enforcement
                • requirement is not satisfiedTryBots-Pass
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: newpatchset
                Gerrit-Project: tools
                Gerrit-Branch: master
                Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
                Gerrit-Change-Number: 702555
                Gerrit-PatchSet: 23
                Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
                Gerrit-Reviewer: Alan Donovan <adon...@google.com>
                Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
                Gerrit-Attention: Mateusz Poliwczak <mpoliw...@gmail.com>
                Gerrit-Attention: Alan Donovan <adon...@google.com>
                unsatisfied_requirement
                satisfied_requirement
                open
                diffy

                Mateusz Poliwczak (Gerrit)

                unread,
                Apr 7, 2026, 2:17:39 PM (2 days ago) Apr 7
                to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
                Attention needed from Alan Donovan

                Mateusz Poliwczak uploaded new patchset

                Mateusz Poliwczak uploaded patch set #24 to this change.
                Open in Gerrit

                Related details

                Attention is currently required from:
                • Alan Donovan
                Submit Requirements:
                • requirement is not satisfiedCode-Review
                • requirement satisfiedNo-Unresolved-Comments
                • requirement is not satisfiedReview-Enforcement
                • requirement is not satisfiedTryBots-Pass
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: newpatchset
                Gerrit-Project: tools
                Gerrit-Branch: master
                Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
                Gerrit-Change-Number: 702555
                Gerrit-PatchSet: 24
                Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
                Gerrit-Reviewer: Alan Donovan <adon...@google.com>
                Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
                Gerrit-Attention: Alan Donovan <adon...@google.com>
                unsatisfied_requirement
                satisfied_requirement
                open
                diffy

                Mateusz Poliwczak (Gerrit)

                unread,
                Apr 7, 2026, 2:17:39 PM (2 days ago) Apr 7
                to goph...@pubsubhelper.golang.org, Go LUCI, Alan Donovan, golang-co...@googlegroups.com
                Attention needed from Alan Donovan

                Mateusz Poliwczak voted Commit-Queue+1

                Commit-Queue+1
                Open in Gerrit

                Related details

                Attention is currently required from:
                • Alan Donovan
                Submit Requirements:
                • requirement is not satisfiedCode-Review
                • requirement satisfiedNo-Unresolved-Comments
                • requirement is not satisfiedReview-Enforcement
                • requirement is not satisfiedTryBots-Pass
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: tools
                Gerrit-Branch: master
                Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
                Gerrit-Change-Number: 702555
                Gerrit-PatchSet: 24
                Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
                Gerrit-Reviewer: Alan Donovan <adon...@google.com>
                Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
                Gerrit-Attention: Alan Donovan <adon...@google.com>
                Gerrit-Comment-Date: Tue, 07 Apr 2026 18:17:32 +0000
                Gerrit-HasComments: No
                Gerrit-Has-Labels: Yes
                unsatisfied_requirement
                satisfied_requirement
                open
                diffy

                Alan Donovan (Gerrit)

                unread,
                Apr 8, 2026, 10:59:40 PM (3 hours ago) Apr 8
                to Mateusz Poliwczak, goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com
                Attention needed from Mateusz Poliwczak

                Alan Donovan added 2 comments

                File gopls/internal/golang/semtok.go
                Line 620, Patchset 11: if obj, ok := tv.info.Defs[id]; obj != nil {
                Alan Donovan . unresolved

                This if/else reproduces the case analysis in the caller. Can we combine them? i.e. move L623-627 to L654 etc.

                Mateusz Poliwczak

                Done

                Alan Donovan

                Sorry, when I suggested this the total amount of code seemed small, but the current draft now puts a lot of detailed logic in the `ident` case, obscuring the structure. Let's revert to having an isShadowing helper that reports whether to add the "shadow" modifier. It's ok if it re-does the Defs lookup.

                Line 636, Patchset 24 (Latest): // Ignore identifiers in function types, that are not part of a function
                // decl or literal. There is no way to use these identifiers directly,
                // so no need to report such modifiers for these.
                Alan Donovan . unresolved

                I think what this comment is trying to say is:

                // A FuncType may be the signature of a Func{Decl,Lit} or just a func type.
                // Any object declared within a FuncType must be a TypeParam, Param, or Result.
                // The only reference to such an object can be within a function body.
                // Since a func type has no function body, there can be no references to the
                // object, and shadowing is irrelevant. So omit the modifier in that case.

                Open in Gerrit

                Related details

                Attention is currently required from:
                • Mateusz Poliwczak
                Submit Requirements:
                  • requirement is not satisfiedCode-Review
                  • requirement is not satisfiedNo-Unresolved-Comments
                  • requirement is not satisfiedReview-Enforcement
                  • requirement satisfiedTryBots-Pass
                  Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                  Gerrit-MessageType: comment
                  Gerrit-Project: tools
                  Gerrit-Branch: master
                  Gerrit-Change-Id: I6a6a6964b6326f0da679690a59d969eed6cf8cfb
                  Gerrit-Change-Number: 702555
                  Gerrit-PatchSet: 24
                  Gerrit-Owner: Mateusz Poliwczak <mpoliw...@gmail.com>
                  Gerrit-Reviewer: Alan Donovan <adon...@google.com>
                  Gerrit-Reviewer: Mateusz Poliwczak <mpoliw...@gmail.com>
                  Gerrit-Attention: Mateusz Poliwczak <mpoliw...@gmail.com>
                  Gerrit-Comment-Date: Thu, 09 Apr 2026 02:59:35 +0000
                  Gerrit-HasComments: Yes
                  Gerrit-Has-Labels: No
                  unsatisfied_requirement
                  satisfied_requirement
                  open
                  diffy
                  Reply all
                  Reply to author
                  Forward
                  0 new messages