[tools] gopls/internal/golang/completion: report types in unimported completion

11 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Sep 5, 2026, 11:41:10 AMSep 5
to goph...@pubsubhelper.golang.org, Sergei Efremov, golang-co...@googlegroups.com

Gerrit Bot has uploaded the change for review

Commit message

gopls/internal/golang/completion: report types in unimported completion

pkgIDmatches handled only the Function, Variable, Struct and Constant symbol
kinds, so an interface or a named non-struct type from a workspace package was
dropped, and a struct type was reported as "var". Report every type as
"type (from ...)", as the other two search paths already do.

All three paths gave a type VariableCompletion, so editors drew a variable icon
beside an item whose detail read "type". Use InterfaceCompletion for an
interface and ClassCompletion otherwise. The standard library and module cache
indexes do not record whether a type is an interface, so those two paths always
use ClassCompletion.

Fixes golang/go#81369
Change-Id: I47e34475797d5026925150b70297550246cb1d34
GitHub-Last-Rev: 756ed795b9d4d4aa688579472f9c21992349993e
GitHub-Pull-Request: golang/tools#677

Change diff

diff --git a/gopls/internal/golang/completion/unimported.go b/gopls/internal/golang/completion/unimported.go
index 79ec3d7..2fcc6cf 100644
--- a/gopls/internal/golang/completion/unimported.go
+++ b/gopls/internal/golang/completion/unimported.go
@@ -233,9 +233,15 @@
}
kind = protocol.FunctionCompletion
detail = fmt.Sprintf("func (from %q)", pkg.PkgPath)
- case protocol.Variable, protocol.Struct:
+ case protocol.Variable:
kind = protocol.VariableCompletion
detail = fmt.Sprintf("var (from %q)", pkg.PkgPath)
+ case protocol.Interface:
+ kind = protocol.InterfaceCompletion
+ detail = fmt.Sprintf("type (from %q)", pkg.PkgPath)
+ case protocol.Struct, protocol.Class:
+ kind = protocol.ClassCompletion
+ detail = fmt.Sprintf("type (from %q)", pkg.PkgPath)
case protocol.Constant:
kind = protocol.ConstantCompletion
detail = fmt.Sprintf("const (from %q)", pkg.PkgPath)
@@ -284,7 +290,7 @@
kind = protocol.VariableCompletion
detail = fmt.Sprintf("var (from %q)", candpkg)
case stdlib.Type:
- kind = protocol.VariableCompletion
+ kind = protocol.ClassCompletion
detail = fmt.Sprintf("type (from %q)", candpkg)
default:
continue
@@ -331,7 +337,7 @@
kind = protocol.ConstantCompletion
detail = fmt.Sprintf("const (from %s)", cand.ImportPath)
case modindex.Type: // might be a type alias
- kind = protocol.VariableCompletion
+ kind = protocol.ClassCompletion
detail = fmt.Sprintf("type (from %s)", cand.ImportPath)
default:
continue
diff --git a/gopls/internal/test/marker/testdata/completion/unimported.txt b/gopls/internal/test/marker/testdata/completion/unimported.txt
index be10595..7835266 100644
--- a/gopls/internal/test/marker/testdata/completion/unimported.txt
+++ b/gopls/internal/test/marker/testdata/completion/unimported.txt
@@ -21,6 +21,13 @@
package foo

type StructFoo struct{ F int }
+type ArrayFoo [16]byte
+type InterfaceFoo interface{}
+type FuncFoo func(int)
+
+const ConstFoo = 1
+
+var VarFoo = 2

-- baz/baz.go --
package baz
@@ -41,6 +48,10 @@
signature.Foo //@complete(re"()Foo", signaturefoo)

context.Bac //@complete(re"() \\/\\/", contextBackground)
+
+ // Every kind of exported declaration of a workspace package that is not
+ // imported yet.
+ foo. //@complete(re"foo.() \\/\\/", fooArray, fooConst, fooFunc, fooInterface, fooStruct, fooVar)
}

// Create markers for unimported std lib packages. Only for use by this test.
@@ -49,7 +60,14 @@
/* httptrace */ //@item(httptrace, "httptrace", "\"net/http/httptrace\"", "package")
/* httputil */ //@item(httputil, "httputil", "\"net/http/httputil\"", "package")

-/* ring.Ring */ //@item(ringring, "Ring", "type (from \"container/ring\")", "var")
+/* ring.Ring */ //@item(ringring, "Ring", "type (from \"container/ring\")", "type")
+
+/* foo.ArrayFoo */ //@item(fooArray, "ArrayFoo", "type (from \"unimported.test/foo\")", "type")
+/* foo.ConstFoo */ //@item(fooConst, "ConstFoo", "const (from \"unimported.test/foo\")", "const")
+/* foo.FuncFoo */ //@item(fooFunc, "FuncFoo", "func (from \"unimported.test/foo\")", "func")
+/* foo.InterfaceFoo */ //@item(fooInterface, "InterfaceFoo", "type (from \"unimported.test/foo\")", "interface")
+/* foo.StructFoo */ //@item(fooStruct, "StructFoo", "type (from \"unimported.test/foo\")", "type")
+/* foo.VarFoo */ //@item(fooVar, "VarFoo", "var (from \"unimported.test/foo\")", "var")

/* signature.Foo */ //@item(signaturefoo, "Foo", "func (from \"unimported.test/signature\")", "func")

Change information

Files:
  • M gopls/internal/golang/completion/unimported.go
  • M gopls/internal/test/marker/testdata/completion/unimported.txt
Change size: S
Delta: 2 files changed, 28 insertions(+), 4 deletions(-)
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: I47e34475797d5026925150b70297550246cb1d34
Gerrit-Change-Number: 828104
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Gopher Robot (Gerrit)

unread,
Sep 5, 2026, 11:41:12 AMSep 5
to Sergei Efremov, Gerrit Bot, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gopher Robot added 1 comment

Patchset-level comments
File-level comment, Patchset 1 (Latest):
Gopher Robot . unresolved

I spotted some possible problems with your PR:

  1. You have a long 79 character line in the commit message body. Please add line breaks to long lines that should be wrapped. Lines in the commit message body should be wrapped at ~76 characters unless needed for things like URLs or tables. (Note: GitHub might render long lines as soft-wrapped, so double-check in the Gerrit commit message shown above.)

Please address any problems by updating the GitHub PR.

When complete, mark this comment as 'Done' and click the [blue 'Reply' button](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it) above. These findings are based on heuristics; if a finding does not apply, briefly reply here saying so.

To update the commit title or commit message body shown here in Gerrit, you must edit the GitHub PR title and PR description (the first comment) in the GitHub web interface using the 'Edit' button or 'Edit' menu entry there. Note: pushing a new commit to the PR will not automatically update the commit message used by Gerrit.

For more details, see:

(In general for Gerrit code reviews, the change author is expected to [log in to Gerrit](https://go-review.googlesource.com/login/) with a Gmail or other Google account and then close out each piece of feedback by marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)

Open in Gerrit

Related details

Attention set is empty
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: I47e34475797d5026925150b70297550246cb1d34
    Gerrit-Change-Number: 828104
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
    Gerrit-Comment-Date: Sat, 05 Sep 2026 15:41:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Gopher Robot (Gerrit)

    unread,
    Sep 5, 2026, 11:45:39 AMSep 5
    to Sergei Efremov, Gerrit Bot, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Message from Gopher Robot

    Congratulations on opening your first change. Thank you for your contribution!

    Next steps:
    A maintainer will review your change and provide feedback. See
    https://go.dev/doc/contribute#review for more info and tips to get your
    patch through code review.

    Most changes in the Go project go through a few rounds of revision. This can be
    surprising to people new to the project. The careful, iterative review process
    is our way of helping mentor contributors and ensuring that their contributions
    have a lasting impact.

    Open in Gerrit

    Related details

    Attention set is empty
    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: I47e34475797d5026925150b70297550246cb1d34
    Gerrit-Change-Number: 828104
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
    Gerrit-Comment-Date: Sat, 05 Sep 2026 15:45:35 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Sergei Efremov (Gerrit)

    unread,
    Sep 5, 2026, 11:50:50 AMSep 5
    to Gerrit Bot, goph...@pubsubhelper.golang.org, Gopher Robot, golang-co...@googlegroups.com

    Sergei Efremov added 2 comments

    Patchset-level comments
    Gopher Robot . resolved

    I spotted some possible problems with your PR:

      1. You have a long 79 character line in the commit message body. Please add line breaks to long lines that should be wrapped. Lines in the commit message body should be wrapped at ~76 characters unless needed for things like URLs or tables. (Note: GitHub might render long lines as soft-wrapped, so double-check in the Gerrit commit message shown above.)

    Please address any problems by updating the GitHub PR.

    When complete, mark this comment as 'Done' and click the [blue 'Reply' button](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it) above. These findings are based on heuristics; if a finding does not apply, briefly reply here saying so.

    To update the commit title or commit message body shown here in Gerrit, you must edit the GitHub PR title and PR description (the first comment) in the GitHub web interface using the 'Edit' button or 'Edit' menu entry there. Note: pushing a new commit to the PR will not automatically update the commit message used by Gerrit.

    For more details, see:

    (In general for Gerrit code reviews, the change author is expected to [log in to Gerrit](https://go-review.googlesource.com/login/) with a Gmail or other Google account and then close out each piece of feedback by marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)

    Sergei Efremov

    Done

    Sergei Efremov . resolved

    Fixed line length in the commit message body.

    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: comment
      Gerrit-Project: tools
      Gerrit-Branch: master
      Gerrit-Change-Id: I47e34475797d5026925150b70297550246cb1d34
      Gerrit-Change-Number: 828104
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
      Gerrit-Comment-Date: Sat, 05 Sep 2026 15:50:42 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Gopher Robot <go...@golang.org>
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Gerrit Bot (Gerrit)

      unread,
      Sep 5, 2026, 11:58:57 AMSep 5
      to Sergei Efremov, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Gerrit Bot uploaded new patchset

      Gerrit Bot uploaded patch set #2 to this change.
      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: newpatchset
      Gerrit-Project: tools
      Gerrit-Branch: master
      Gerrit-Change-Id: I47e34475797d5026925150b70297550246cb1d34
      Gerrit-Change-Number: 828104
      Gerrit-PatchSet: 2
      unsatisfied_requirement
      satisfied_requirement
      open
      diffy

      Peter Weinberger (Gerrit)

      unread,
      Sep 8, 2026, 3:04:31 PMSep 8
      to Sergei Efremov, Gerrit Bot, goph...@pubsubhelper.golang.org, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com

      Peter Weinberger added 3 comments

      Patchset-level comments
      File-level comment, Patchset 2 (Latest):
      Peter Weinberger . unresolved

      Thanks for trying this. I made a couple of comments, but I'm not sure this is solving the whole problem. Does type F func() report 'type' even if it is satisfied from the workspace? (i think unimported completions from stdlib and module cache do report 'type')

      File gopls/internal/golang/completion/unimported.go
      Line 242, Patchset 2 (Latest): case protocol.Struct, protocol.Class:
      Peter Weinberger . unresolved

      these two cases could be combined.

      File gopls/internal/test/marker/testdata/completion/unimported.txt
      Line 28, Patchset 2 (Latest):const ConstFoo = 1
      Peter Weinberger . unresolved

      what exactly is this test testing? do we need ConstFoo and VarFoo?

      Open in Gerrit

      Related details

      Attention set is empty
      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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 2
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Comment-Date: Tue, 08 Sep 2026 19:04:25 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        unsatisfied_requirement
        open
        diffy

        Sergei Efremov (Gerrit)

        unread,
        Sep 8, 2026, 4:46:23 PMSep 8
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Peter Weinberger, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com

        Sergei Efremov added 4 comments

        Patchset-level comments
        Peter Weinberger . unresolved

        Thanks for trying this. I made a couple of comments, but I'm not sure this is solving the whole problem. Does type F func() report 'type' even if it is satisfied from the workspace? (i think unimported completions from stdlib and module cache do report 'type')

        Sergei Efremov

        Yes, you are right. As you can see in tests. type FuncFoo func is still shows as 'func'.

        Before going further I'd like a check that I have read this right.

        To be exact, the code I am referring to is the case *ast.FuncType inside the
        `*ast.TypeSpec` branch of `symbolizeFile` in `gopls/internal/cache/symbols/symbols.go`,
        and the same case in typeDetails in `gopls/internal/golang/symbols.go`. Both assign `protocol.Function`.

        A real function never reaches either of those lines: a function declaration is an
        `*ast.FuncDecl` and is handled in a separate branch. Anything reaching the
        `*ast.TypeSpec` code is a type declaration, so the `*ast.FuncType` there is the right hand side of `type F func()`, not a function.

        The effect shows up in completion. A declaration like `type FuncFoo func(int)`
        carries the same kind as a real function, so pkgIDmatches in
        `gopls/internal/golang/completion/unimported.go` cannot tell the two apart and
        offers FuncFoo as `func (from "example.com/foo")`. The other two search paths
        report a type: stdlibMatches offers net/http.HandlerFunc as
        `type (from "net/http")` from stdlib.Type, and modcacheMatches does the same from
        modindex.Type.

        Is that intended, or should the two *ast.FuncType cases assign protocol.Class?

        Peter Weinberger . unresolved

        Thanks for trying this. I made a couple of comments, but I'm not sure this is solving the whole problem. Does type F func() report 'type' even if it is satisfied from the workspace? (i think unimported completions from stdlib and module cache do report 'type')

        Sergei Efremov

        Yes, you are right in case of

        File gopls/internal/golang/completion/unimported.go
        Line 242, Patchset 2 (Latest): case protocol.Struct, protocol.Class:
        Peter Weinberger . unresolved

        these two cases could be combined.

        Sergei Efremov

        Will merge them. Before I do - is the concern the duplicated body, or that the interface icon is only available for workspace packages and so is inconsistent with the stdlib and modcache paths? Asking because if it's the latter I'll drop InterfaceCompletion entirely rather than keep it behind a conditional.

        File gopls/internal/test/marker/testdata/completion/unimported.txt
        Peter Weinberger . unresolved

        what exactly is this test testing? do we need ConstFoo and VarFoo?

        Sergei Efremov

        Mostly for completeness. The @complete marker lists every item, so the test reads
        as a table of declaration kind against the label completion reports for it. If you find it as dead weight - I can drop it.

        Open in Gerrit

        Related details

        Attention set is empty
        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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 2
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Comment-Date: Tue, 08 Sep 2026 20:46:15 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Peter Weinberger <p...@google.com>
        unsatisfied_requirement
        open
        diffy

        Peter Weinberger (Gerrit)

        unread,
        Sep 8, 2026, 5:02:00 PMSep 8
        to Sergei Efremov, Gerrit Bot, goph...@pubsubhelper.golang.org, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com

        Peter Weinberger added 2 comments

        Patchset-level comments
        Peter Weinberger . unresolved

        Thanks for trying this. I made a couple of comments, but I'm not sure this is solving the whole problem. Does type F func() report 'type' even if it is satisfied from the workspace? (i think unimported completions from stdlib and module cache do report 'type')

        Sergei Efremov

        Yes, you are right. As you can see in tests. type FuncFoo func is still shows as 'func'.

        Before going further I'd like a check that I have read this right.

        To be exact, the code I am referring to is the case *ast.FuncType inside the
        `*ast.TypeSpec` branch of `symbolizeFile` in `gopls/internal/cache/symbols/symbols.go`,
        and the same case in typeDetails in `gopls/internal/golang/symbols.go`. Both assign `protocol.Function`.

        A real function never reaches either of those lines: a function declaration is an
        `*ast.FuncDecl` and is handled in a separate branch. Anything reaching the
        `*ast.TypeSpec` code is a type declaration, so the `*ast.FuncType` there is the right hand side of `type F func()`, not a function.

        The effect shows up in completion. A declaration like `type FuncFoo func(int)`
        carries the same kind as a real function, so pkgIDmatches in
        `gopls/internal/golang/completion/unimported.go` cannot tell the two apart and
        offers FuncFoo as `func (from "example.com/foo")`. The other two search paths
        report a type: stdlibMatches offers net/http.HandlerFunc as
        `type (from "net/http")` from stdlib.Type, and modcacheMatches does the same from
        modindex.Type.

        Is that intended, or should the two *ast.FuncType cases assign protocol.Class?

        Peter Weinberger

        I think the big question is what the Detail field should be for all possible circumstances. If getting there is too much for one CL that's ok. What the code does now doesn't really matter if it's wrong. (It might be that if the changes are too extensive, maybe it's not worth the effort, but that's a later decision.)

        File gopls/internal/golang/completion/unimported.go
        Line 242, Patchset 2 (Latest): case protocol.Struct, protocol.Class:
        Peter Weinberger . unresolved

        these two cases could be combined.

        Sergei Efremov

        Will merge them. Before I do - is the concern the duplicated body, or that the interface icon is only available for workspace packages and so is inconsistent with the stdlib and modcache paths? Asking because if it's the latter I'll drop InterfaceCompletion entirely rather than keep it behind a conditional.

        Peter Weinberger

        It was just the duplicated code.

        Open in Gerrit

        Related details

        Attention set is empty
        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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 2
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Comment-Date: Tue, 08 Sep 2026 21:01:53 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Sergei Efremov <efremof...@gmail.com>
        Comment-In-Reply-To: Peter Weinberger <p...@google.com>
        unsatisfied_requirement
        open
        diffy

        Sergei Efremov (Gerrit)

        unread,
        Sep 9, 2026, 5:26:14 AMSep 9
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Peter Weinberger, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com

        Sergei Efremov added 2 comments

        Patchset-level comments
        Peter Weinberger . unresolved

        Thanks for trying this. I made a couple of comments, but I'm not sure this is solving the whole problem. Does type F func() report 'type' even if it is satisfied from the workspace? (i think unimported completions from stdlib and module cache do report 'type')

        Sergei Efremov

        Yes, you are right. As you can see in tests. type FuncFoo func is still shows as 'func'.

        Before going further I'd like a check that I have read this right.

        To be exact, the code I am referring to is the case *ast.FuncType inside the
        `*ast.TypeSpec` branch of `symbolizeFile` in `gopls/internal/cache/symbols/symbols.go`,
        and the same case in typeDetails in `gopls/internal/golang/symbols.go`. Both assign `protocol.Function`.

        A real function never reaches either of those lines: a function declaration is an
        `*ast.FuncDecl` and is handled in a separate branch. Anything reaching the
        `*ast.TypeSpec` code is a type declaration, so the `*ast.FuncType` there is the right hand side of `type F func()`, not a function.

        The effect shows up in completion. A declaration like `type FuncFoo func(int)`
        carries the same kind as a real function, so pkgIDmatches in
        `gopls/internal/golang/completion/unimported.go` cannot tell the two apart and
        offers FuncFoo as `func (from "example.com/foo")`. The other two search paths
        report a type: stdlibMatches offers net/http.HandlerFunc as
        `type (from "net/http")` from stdlib.Type, and modcacheMatches does the same from
        modindex.Type.

        Is that intended, or should the two *ast.FuncType cases assign protocol.Class?

        Peter Weinberger

        I think the big question is what the Detail field should be for all possible circumstances. If getting there is too much for one CL that's ok. What the code does now doesn't really matter if it's wrong. (It might be that if the changes are too extensive, maybe it's not worth the effort, but that's a later decision.)

        Sergei Efremov

        I gave it a try. It seems fine, and my local tests are passing. But you're right: the big question is what we want to see. If it's F func(), we should report 'type', and the patch does that. I'm not confident I've found everything this affects, though. I'm less optimistic after you pointed out that gap 😊

        File gopls/internal/golang/completion/unimported.go
        Line 242, Patchset 2 (Latest): case protocol.Struct, protocol.Class:
        Peter Weinberger . unresolved

        these two cases could be combined.

        Sergei Efremov

        Will merge them. Before I do - is the concern the duplicated body, or that the interface icon is only available for workspace packages and so is inconsistent with the stdlib and modcache paths? Asking because if it's the latter I'll drop InterfaceCompletion entirely rather than keep it behind a conditional.

        Peter Weinberger

        It was just the duplicated code.

        Sergei Efremov

        Ok, simplified.

        Open in Gerrit

        Related details

        Attention set is empty
        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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 2
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Comment-Date: Wed, 09 Sep 2026 09:26:05 +0000
        unsatisfied_requirement
        open
        diffy

        Gerrit Bot (Gerrit)

        unread,
        Sep 9, 2026, 5:27:08 AMSep 9
        to Sergei Efremov, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
        Attention needed from Peter Weinberger

        Gerrit Bot uploaded new patchset

        Gerrit Bot uploaded patch set #3 to this change.
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Peter Weinberger
        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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Attention: Peter Weinberger <p...@google.com>
        unsatisfied_requirement
        open
        diffy

        Sergei Efremov (Gerrit)

        unread,
        Sep 9, 2026, 11:00:59 AMSep 9
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Peter Weinberger, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Peter Weinberger

        Sergei Efremov added 1 comment

        File gopls/internal/golang/symbols.go
        Line 253, Patchset 3 (Latest): // A named function type declares a type, not a function.
        Sergei Efremov . unresolved

        Added here explicit switch for visibility.
        It could be deleted and `*ast.FuncType` be process by default rule.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Peter Weinberger
        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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Attention: Peter Weinberger <p...@google.com>
        Gerrit-Comment-Date: Wed, 09 Sep 2026 15:00:49 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        unsatisfied_requirement
        open
        diffy

        Peter Weinberger (Gerrit)

        unread,
        Sep 9, 2026, 12:16:18 PMSep 9
        to Sergei Efremov, Gerrit Bot, goph...@pubsubhelper.golang.org, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Sergei Efremov

        Peter Weinberger added 6 comments

        Patchset-level comments
        File-level comment, Patchset 2:
        Peter Weinberger . resolved

        Thanks for trying this. I made a couple of comments, but I'm not sure this is solving the whole problem. Does type F func() report 'type' even if it is satisfied from the workspace? (i think unimported completions from stdlib and module cache do report 'type')

        Sergei Efremov

        Yes, you are right. As you can see in tests. type FuncFoo func is still shows as 'func'.

        Before going further I'd like a check that I have read this right.

        To be exact, the code I am referring to is the case *ast.FuncType inside the
        `*ast.TypeSpec` branch of `symbolizeFile` in `gopls/internal/cache/symbols/symbols.go`,
        and the same case in typeDetails in `gopls/internal/golang/symbols.go`. Both assign `protocol.Function`.

        A real function never reaches either of those lines: a function declaration is an
        `*ast.FuncDecl` and is handled in a separate branch. Anything reaching the
        `*ast.TypeSpec` code is a type declaration, so the `*ast.FuncType` there is the right hand side of `type F func()`, not a function.

        The effect shows up in completion. A declaration like `type FuncFoo func(int)`
        carries the same kind as a real function, so pkgIDmatches in
        `gopls/internal/golang/completion/unimported.go` cannot tell the two apart and
        offers FuncFoo as `func (from "example.com/foo")`. The other two search paths
        report a type: stdlibMatches offers net/http.HandlerFunc as
        `type (from "net/http")` from stdlib.Type, and modcacheMatches does the same from
        modindex.Type.

        Is that intended, or should the two *ast.FuncType cases assign protocol.Class?

        Peter Weinberger

        I think the big question is what the Detail field should be for all possible circumstances. If getting there is too much for one CL that's ok. What the code does now doesn't really matter if it's wrong. (It might be that if the changes are too extensive, maybe it's not worth the effort, but that's a later decision.)

        Sergei Efremov

        I gave it a try. It seems fine, and my local tests are passing. But you're right: the big question is what we want to see. If it's F func(), we should report 'type', and the patch does that. I'm not confident I've found everything this affects, though. I'm less optimistic after you pointed out that gap 😊

        Peter Weinberger

        Done

        File-level comment, Patchset 3 (Latest):
        Peter Weinberger . resolved

        progress (and a misunderstanding on my part(

        File gopls/internal/golang/completion/unimported.go
        Line 242, Patchset 2: case protocol.Struct, protocol.Class:
        Peter Weinberger . resolved

        these two cases could be combined.

        Sergei Efremov

        Will merge them. Before I do - is the concern the duplicated body, or that the interface icon is only available for workspace packages and so is inconsistent with the stdlib and modcache paths? Asking because if it's the latter I'll drop InterfaceCompletion entirely rather than keep it behind a conditional.

        Peter Weinberger

        It was just the duplicated code.

        Sergei Efremov

        Ok, simplified.

        Peter Weinberger

        Marked as resolved.

        Line 242, Patchset 2: case protocol.Struct, protocol.Class:
        Peter Weinberger . unresolved

        these two cases could be combined.

        Sergei Efremov

        Will merge them. Before I do - is the concern the duplicated body, or that the interface icon is only available for workspace packages and so is inconsistent with the stdlib and modcache paths? Asking because if it's the latter I'll drop InterfaceCompletion entirely rather than keep it behind a conditional.

        Peter Weinberger

        It was just the duplicated code.

        Sergei Efremov

        Ok, simplified.

        Peter Weinberger

        I misunderstood what you said. I didn't mean for you to give up on InterfaceCompletion. Sorry for the confusion

        File gopls/internal/golang/symbols.go
        Line 253, Patchset 3 (Latest): // A named function type declares a type, not a function.
        Sergei Efremov . unresolved

        Added here explicit switch for visibility.
        It could be deleted and `*ast.FuncType` be process by default rule.

        Peter Weinberger

        i think that would be ok.

        File gopls/internal/test/marker/testdata/completion/unimported.txt
        Line 28, Patchset 2:const ConstFoo = 1
        Peter Weinberger . unresolved

        what exactly is this test testing? do we need ConstFoo and VarFoo?

        Sergei Efremov

        Mostly for completeness. The @complete marker lists every item, so the test reads
        as a table of declaration kind against the label completion reports for it. If you find it as dead weight - I can drop it.

        Peter Weinberger

        Yes, i think it's distracting to have the test test more than it has to.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Sergei Efremov
        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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Attention: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Comment-Date: Wed, 09 Sep 2026 16:16:12 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        unsatisfied_requirement
        open
        diffy

        Sergei Efremov (Gerrit)

        unread,
        Sep 9, 2026, 12:48:51 PMSep 9
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Peter Weinberger, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com

        Sergei Efremov added 3 comments

        File gopls/internal/golang/completion/unimported.go
        Line 242, Patchset 2: case protocol.Struct, protocol.Class:
        Peter Weinberger . unresolved

        these two cases could be combined.

        Sergei Efremov

        Will merge them. Before I do - is the concern the duplicated body, or that the interface icon is only available for workspace packages and so is inconsistent with the stdlib and modcache paths? Asking because if it's the latter I'll drop InterfaceCompletion entirely rather than keep it behind a conditional.

        Peter Weinberger

        It was just the duplicated code.

        Sergei Efremov

        Ok, simplified.

        Peter Weinberger

        I misunderstood what you said. I didn't mean for you to give up on InterfaceCompletion. Sorry for the confusion

        Sergei Efremov

        Reverted it back.

        File gopls/internal/golang/symbols.go
        Line 253, Patchset 3 (Latest): // A named function type declares a type, not a function.
        Sergei Efremov . unresolved

        Added here explicit switch for visibility.
        It could be deleted and `*ast.FuncType` be process by default rule.

        Peter Weinberger

        i think that would be ok.

        Sergei Efremov

        Droped the case.

        File gopls/internal/test/marker/testdata/completion/unimported.txt
        Line 28, Patchset 2:const ConstFoo = 1
        Peter Weinberger . unresolved

        what exactly is this test testing? do we need ConstFoo and VarFoo?

        Sergei Efremov

        Mostly for completeness. The @complete marker lists every item, so the test reads
        as a table of declaration kind against the label completion reports for it. If you find it as dead weight - I can drop it.

        Peter Weinberger

        Yes, i think it's distracting to have the test test more than it has to.

        Sergei Efremov

        Removed ConstFoo and VarFoo.

        Open in Gerrit

        Related details

        Attention set is empty
        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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Comment-Date: Wed, 09 Sep 2026 16:48:43 +0000
        unsatisfied_requirement
        open
        diffy

        Gerrit Bot (Gerrit)

        unread,
        Sep 9, 2026, 1:07:49 PMSep 9
        to Sergei Efremov, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
        Attention needed from Peter Weinberger

        Gerrit Bot uploaded new patchset

        Gerrit Bot uploaded patch set #4 to this change.
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Peter Weinberger
        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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Attention: Peter Weinberger <p...@google.com>
        unsatisfied_requirement
        open
        diffy

        Peter Weinberger (Gerrit)

        unread,
        Sep 9, 2026, 3:38:34 PMSep 9
        to Sergei Efremov, Gerrit Bot, goph...@pubsubhelper.golang.org, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com

        Peter Weinberger voted Commit-Queue+1

        Commit-Queue+1
        Open in Gerrit

        Related details

        Attention set is empty
        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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Comment-Date: Wed, 09 Sep 2026 19:38:27 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        unsatisfied_requirement
        open
        diffy

        Peter Weinberger (Gerrit)

        unread,
        Sep 9, 2026, 4:09:19 PMSep 9
        to Sergei Efremov, Gerrit Bot, goph...@pubsubhelper.golang.org, golang...@luci-project-accounts.iam.gserviceaccount.com, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com

        Peter Weinberger voted Code-Review+2

        Code-Review+2
        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement 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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Comment-Date: Wed, 09 Sep 2026 20:09:12 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Sergei Efremov (Gerrit)

        unread,
        Sep 9, 2026, 7:14:10 PMSep 9
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Peter Weinberger, golang...@luci-project-accounts.iam.gserviceaccount.com, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com

        Sergei Efremov added 3 comments

        File gopls/internal/golang/completion/unimported.go
        Line 242, Patchset 2: case protocol.Struct, protocol.Class:
        Peter Weinberger . resolved

        these two cases could be combined.

        Sergei Efremov

        Will merge them. Before I do - is the concern the duplicated body, or that the interface icon is only available for workspace packages and so is inconsistent with the stdlib and modcache paths? Asking because if it's the latter I'll drop InterfaceCompletion entirely rather than keep it behind a conditional.

        Peter Weinberger

        It was just the duplicated code.

        Sergei Efremov

        Ok, simplified.

        Peter Weinberger

        I misunderstood what you said. I didn't mean for you to give up on InterfaceCompletion. Sorry for the confusion

        Sergei Efremov

        Reverted it back.

        Sergei Efremov

        Done

        File gopls/internal/golang/symbols.go
        Line 253, Patchset 3: // A named function type declares a type, not a function.
        Sergei Efremov . resolved

        Added here explicit switch for visibility.
        It could be deleted and `*ast.FuncType` be process by default rule.

        Peter Weinberger

        i think that would be ok.

        Sergei Efremov

        Droped the case.

        Sergei Efremov

        Done

        File gopls/internal/test/marker/testdata/completion/unimported.txt
        Line 28, Patchset 2:const ConstFoo = 1
        Peter Weinberger . resolved

        what exactly is this test testing? do we need ConstFoo and VarFoo?

        Sergei Efremov

        Mostly for completeness. The @complete marker lists every item, so the test reads
        as a table of declaration kind against the label completion reports for it. If you find it as dead weight - I can drop it.

        Peter Weinberger

        Yes, i think it's distracting to have the test test more than it has to.

        Sergei Efremov

        Removed ConstFoo and VarFoo.

        Sergei Efremov

        Done

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement 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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Comment-Date: Wed, 09 Sep 2026 23:13:59 +0000
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Hongxiang Jiang (Gerrit)

        unread,
        Sep 10, 2026, 10:55:28 AMSep 10
        to Sergei Efremov, Gerrit Bot, goph...@pubsubhelper.golang.org, Peter Weinberger, golang...@luci-project-accounts.iam.gserviceaccount.com, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com

        Hongxiang Jiang voted and added 1 comment

        Votes added by Hongxiang Jiang

        Commit-Queue+1

        1 comment

        Patchset-level comments
        File-level comment, Patchset 4 (Latest):
        Hongxiang Jiang . resolved

        The test failure is not really relevant to your change, re-run.

        I will take a quick scan this week since Peter has already done the review.

        Open in Gerrit

        Related details

        Attention set is empty
        Submit Requirements:
        • requirement 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: I47e34475797d5026925150b70297550246cb1d34
        Gerrit-Change-Number: 828104
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Hongxiang Jiang <hxj...@golang.org>
        Gerrit-Reviewer: Peter Weinberger <p...@google.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Madeline Kalil <mka...@google.com>
        Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
        Gerrit-Comment-Date: Thu, 10 Sep 2026 14:55:24 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Hyang-Ah Hana Kim (Gerrit)

        unread,
        Sep 10, 2026, 2:30:23 PMSep 10
        to Sergei Efremov, Gerrit Bot, goph...@pubsubhelper.golang.org, Hyang-Ah Hana Kim, Hongxiang Jiang, Peter Weinberger, golang...@luci-project-accounts.iam.gserviceaccount.com, Madeline Kalil, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Hongxiang Jiang

        Hyang-Ah Hana Kim voted

        Auto-Submit+1
        Code-Review+1
        Commit-Queue+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Hongxiang Jiang
        Submit Requirements:
          • requirement satisfiedCode-Review
          • requirement satisfiedNo-Unresolved-Comments
          • requirement 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: I47e34475797d5026925150b70297550246cb1d34
          Gerrit-Change-Number: 828104
          Gerrit-PatchSet: 4
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Hongxiang Jiang <hxj...@golang.org>
          Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
          Gerrit-Reviewer: Peter Weinberger <p...@google.com>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-CC: Madeline Kalil <mka...@google.com>
          Gerrit-CC: Sergei Efremov <efremof...@gmail.com>
          Gerrit-Attention: Hongxiang Jiang <hxj...@golang.org>
          Gerrit-Comment-Date: Thu, 10 Sep 2026 18:30:18 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes
          satisfied_requirement
          open
          diffy

          Gopher Robot (Gerrit)

          unread,
          Sep 10, 2026, 2:33:50 PMSep 10
          to Sergei Efremov, Gerrit Bot, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Hyang-Ah Hana Kim, Hongxiang Jiang, Peter Weinberger, golang...@luci-project-accounts.iam.gserviceaccount.com, Madeline Kalil, golang-co...@googlegroups.com

          Gopher Robot submitted the change

          Change information

          Commit message:
          gopls/internal/golang/completion: report types in unimported completion

          pkgIDmatches handled only the Function, Variable, Struct and Constant symbol
          kinds, so an interface or a named non-struct type from a workspace package
          was dropped, and a struct type was reported as "var". Report every type as
          "type (from ...)", as the other two search paths already do.

          All three paths gave a type VariableCompletion, so editors drew a variable
          icon beside an item whose detail read "type". Use InterfaceCompletion for an
          interface and ClassCompletion otherwise. The standard library and module
          cache indexes do not record whether a type is an interface, so those two
          paths always use ClassCompletion.

          Fixes golang/go#81369
          Change-Id: I47e34475797d5026925150b70297550246cb1d34
          GitHub-Last-Rev: aea64d2e37ff303fdaa98e54910663a9c5bb4ad3
          GitHub-Pull-Request: golang/tools#677
          Commit-Queue: Hyang-Ah Hana Kim <hya...@gmail.com>
          Reviewed-by: Peter Weinberger <p...@google.com>
          Reviewed-by: Hyang-Ah Hana Kim <hya...@gmail.com>
          Auto-Submit: Hyang-Ah Hana Kim <hya...@gmail.com>
          Files:
          • M gopls/internal/cache/symbols/symbols.go
          • M gopls/internal/golang/completion/unimported.go
          • M gopls/internal/golang/symbols.go
          • M gopls/internal/test/integration/misc/package_symbols_test.go
          • M gopls/internal/test/marker/testdata/completion/unimported.txt
          Change size: S
          Delta: 5 files changed, 27 insertions(+), 10 deletions(-)
          Branch: refs/heads/master
          Submit Requirements:
          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: I47e34475797d5026925150b70297550246cb1d34
          Gerrit-Change-Number: 828104
          Gerrit-PatchSet: 5
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Gopher Robot <go...@golang.org>
          Gerrit-Reviewer: Hongxiang Jiang <hxj...@golang.org>
          Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
          Gerrit-Reviewer: Peter Weinberger <p...@google.com>
          open
          diffy
          satisfied_requirement
          Reply all
          Reply to author
          Forward
          0 new messages