Skip to content

x/tools/gopls: completion should also provide just the function name #64469

@pjweinb

Description

@pjweinb

gopls version

v0.14.2

go env

irrelevant

What did you do?

I have an existing expression f(a), and I would like to replace it with f(protocol.FWithLongName(a)). After typing protocol.F, the only useful completion offered is the function snippet, which would complete as
f(protocol.FWithLongName(x protocol.TypeWithLongName, y TypeOfSecondArg)(a))
which requires too much editing.

What did you expect to see?

I would like to have seen both the function snippet and just the function names as suggested completions.

What did you see instead?

The unsyntactic completion described above. gopls is not looking at the context when it proposed a snippet where there is already an argument.

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