Skip to content

lsp: LSP should still suggest results even if import not present #32908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jeanbza opened this issue Jul 2, 2019 · 1 comment
Closed

lsp: LSP should still suggest results even if import not present #32908

jeanbza opened this issue Jul 2, 2019 · 1 comment
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.

Comments

@jeanbza
Copy link
Contributor

jeanbza commented Jul 2, 2019

If I start typing json., I expect to get results from all json packages (probably ranked/ordered somehow, with any imports being at the top). Pressing enter on a result from an unimported package should import that package.

However, LSP does not suggest results from anything you have yet to import. This greatly inhibits the code-complete functionality:

  • First I have to go find the exact package of the thing I'm looking for (already the major purpose of code completion for me is lost)
  • I have to manually add it
  • I have to be careful not to save file in vscode, which will run goimports, which will remove my import because nothing uses it
  • Perform auto-complete
  • Save

This is not an ideal situation. It would be greatly alleviated if I could have just use autocomplete to search for the method I'm looking for across all packages.

I realize this is probably hard in a GOPATH-less world, FWIW.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jul 2, 2019
@stamblerre
Copy link
Contributor

We are working on this. See #31906.
Closing as a duplicate.

@golang golang locked and limited conversation to collaborators Jul 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls.
Projects
None yet
Development

No branches or pull requests

3 participants