Skip to content

workspace symbol returns symbols from vendor #3772

@hu3bi

Description

@hu3bi
{
  "key": "ctrl+t",
  "command": "workbench.action.showAllSymbols"
}

This should have the option to exclude symbols, by excluding folders and/or files. For example, I might want to exclude the folder vendor and its contents from symbols.

Right now the setting is completely useless, as it is including any symbol from any go tool or go tool dependency.

Remotely related to golang/go#73493

Initially opened it here: microsoft/vscode#249388


What did I do:

My go.mod file includes the tool directive:

...
tool (
	go.uber.org/nilaway/cmd/nilaway
	golang.org/x/tools/cmd/deadcode
	golang.org/x/tools/cmd/godoc
	golang.org/x/vuln/cmd/govulncheck
	mvdan.cc/gofumpt
)
...

I also vendored all dependencies:

        go mod tidy
	go mod vendor

My gopls settings:

    "gopls": {
        "formatting.gofumpt": true,
        "ui.navigation.symbolScope": "workspace",
        "ui.semanticTokens": true,
    }

What happens:

Intellisense from vscode is working as expected, not including any vendor dependencies.
ctrl+t however does show vendored symbols.

{
  "key": "ctrl+t",
  "command": "workbench.action.showAllSymbols"
}

What I would expect to happen:

ctrl+t should not show any symbols which are part of vendor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.goplsgopls related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions