Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: spurious workspace symbol items #46997

Closed
hyangah opened this issue Jun 30, 2021 · 1 comment
Closed

x/tools/gopls: spurious workspace symbol items #46997

hyangah opened this issue Jun 30, 2021 · 1 comment
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Jun 30, 2021

gopls version v0.7.0
go version 1.16.4

I observed workspace/symbol query returns embedded interfaces while testing whether workspace symbol query can be used for improving vscode-go's interface stub generation feature as described in golang/vscode-go#1547.

See the following - where for query Reader, multiple Readers in the "io" packages were reported.
One is the true io.Reader, while the others are other interfaces that embed and extend io.Reader (ReadWriter, ReadCloser, ...)
I am not sure if this is working as intended or not.

[Trace - 3:38:08 PM] Sending request 'workspace/symbol - (43)'.
Params: {
    "query": "Reader"
}


[Trace - 3:38:08 PM] Received response 'workspace/symbol - (43)' in 25ms.
Result: [
...
    {
        "name": "Reader",
        "kind": 11,
        "location": {
            "uri": "file:///usr/local/Cellar/go/1.16.4/libexec/src/io/io.go",
            "range": {
                "start": {
                    "line": 82,
                    "character": 5
                },
                "end": {
                    "line": 82,
                    "character": 11
                }
            }
        },
        "containerName": "io"
    },
...
    {
        "name": "Reader",
        "kind": 11,
        "location": {
            "uri": "file:///usr/local/Cellar/go/1.16.4/libexec/src/io/io.go",
            "range": {
                "start": {
                    "line": 126,
                    "character": 1
                },
                "end": {
                    "line": 126,
                    "character": 7
                }
            }
        },
        "containerName": "io"
    },
    {
        "name": "Reader",
        "kind": 11,
        "location": {
            "uri": "file:///usr/local/Cellar/go/1.16.4/libexec/src/io/io.go",
            "range": {
                "start": {
                    "line": 132,
                    "character": 1
                },
                "end": {
                    "line": 132,
                    "character": 7
                }
            }
        },
        "containerName": "io"
    },
    {
        "name": "Reader",
        "kind": 11,
        "location": {
            "uri": "file:///usr/local/Cellar/go/1.16.4/libexec/src/io/io.go",
            "range": {
                "start": {
                    "line": 144,
                    "character": 1
                },
                "end": {
                    "line": 144,
                    "character": 7
                }
            }
        },
        "containerName": "io"
    },
    {
        "name": "Reader",
        "kind": 11,
        "location": {
            "uri": "file:///usr/local/Cellar/go/1.16.4/libexec/src/io/io.go",
            "range": {
                "start": {
                    "line": 151,
                    "character": 1
                },
                "end": {
                    "line": 151,
                    "character": 7
                }
            }
        },
        "containerName": "io"
    },
    {
        "name": "Reader",
        "kind": 11,
        "location": {
            "uri": "file:///usr/local/Cellar/go/1.16.4/libexec/src/io/io.go",
            "range": {
                "start": {
                    "line": 158,
                    "character": 1
                },
                "end": {
                    "line": 158,
                    "character": 7
                }
            }
        },
        "containerName": "io"
    },
    {
        "name": "Reader",
        "kind": 11,
        "location": {
            "uri": "file:///usr/local/Cellar/go/1.16.4/libexec/src/io/io.go",
            "range": {
                "start": {
                    "line": 171,
                    "character": 1
                },
                "end": {
                    "line": 171,
                    "character": 7
                }
            }
        },
        "containerName": "io"
    },
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jun 30, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jun 30, 2021
@findleyr findleyr modified the milestones: Unreleased, gopls/v0.7.1 Jul 1, 2021
@findleyr findleyr self-assigned this Jul 14, 2021
@gopherbot
Copy link

Change https://golang.org/cl/334531 mentions this issue: internal/lsp/source: workspace symbol improvements for selectors

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

3 participants