Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/gopls: autocomplete in package declaration #34008
This might be a particularly complicated change actually, because this type of completion would only be triggered when we don't know the name of the package so we won't have good type information. The autocompletion code can be found here: https://github.com/golang/tools/blob/master/internal/lsp/source/completion.go, but I think that you will basically need to create a case that does this here: https://github.com/golang/tools/blob/27d1b4e4f3c75e4e2c92ae1b99a67c7f34185617/internal/lsp/source/completion.go#L394, when we fail to get a package for the given file.