Skip to content

x/tools/gopls: completion: rank 'struct' higher than imported symbols #73713

@xieyuschen

Description

@xieyuschen

gopls version

v0.18.1

go env

irrelevant

What did you do?

Type struc inside a map declaration, and imports go/ast and go/types. You can use golang/tools package cmd/deadcode/deadcode.go to verify it.

What did you see happen?

I saw 3 symbols from the other packages are suggested above struct.

Image

What did you expect to see?

I want the struct to be suggested with a higher score, so it could be put above the other 3 symbols from imported packages. The higher score should be given at least when a type usage is proper.

I can help to do the code change.

Editor and settings

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.gopls/completionIssues related to auto-completion in gopls.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions