Skip to content

x/tools/gopls: offer undeclared names in lexical completion #69993

Closed as not planned
@findleyr

Description

@findleyr

This issue is extracted from #69980, where the request is to include undeclared (but used) names in lexical completion results.
We could do this by extracting such names from type errors (see also gopls/internal/analysis/undeclaredname).

I think we're much less likely to implement this feature than we are to offer the fix in #69980. Presumably it's much more important to help users fix their incorrect syntax, than it is to operate as though the syntax were valid. Putting in the unplanned milestone.

func _() {
  myvariable = 2
  foo(myv_) <-- offer 'myvariable' in lexical completion results here
}

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