Skip to content

x/tools/gopls: completion: in new file, offer "package main" first if adjacent files declare "package main" #72993

@xieyuschen

Description

@xieyuschen

In latest gopls(cb292c67c19fd2ca6a9be9ad561c136043fd0472), when I use ctrl+i to trigger suggestion in an empty file a.go, the suggestion main doesn't appear at the top.

➜  go-playground tree .
.
├── a.go
├── go.mod
└── main.go

Image

I expect when there is a go file with package main clause, gopls should put main as the first alternative.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeToolProposalIssues describing a requested change to a Go tool or command-line program.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions