Skip to content

Add autoimport and rename support for langservers#3196

Merged
w0rp merged 3 commits into
dense-analysis:masterfrom
jeremija:autoimport-langserver-pr
Aug 5, 2020
Merged

Add autoimport and rename support for langservers#3196
w0rp merged 3 commits into
dense-analysis:masterfrom
jeremija:autoimport-langserver-pr

Conversation

@jeremija
Copy link
Copy Markdown
Contributor

This PR contains the following updates:

  • ALERename command now works with langservers (previously only with tsserver).
  • Autoimport functionality now works with langservers (previously only with tsserver).

I've been using both with gopls for a few months and it's been working pretty well.

Closes #2976

Copy link
Copy Markdown
Member

@w0rp w0rp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. I'll merge this now.

I went looking for this as I want to add a command to ALE that takes advantage of completions with imports so we can find the word under the cursor and insert the import line that we find.

@w0rp w0rp merged commit 1bd7b3e into dense-analysis:master Aug 5, 2020
@w0rp
Copy link
Copy Markdown
Member

w0rp commented Aug 5, 2020

Cheers! 🍻

@w0rp
Copy link
Copy Markdown
Member

w0rp commented Aug 5, 2020

I'll add a new import setting and deprecate the old one, as it mentions tsserver in the name.

@w0rp w0rp mentioned this pull request Aug 5, 2020
@w0rp
Copy link
Copy Markdown
Member

w0rp commented Aug 9, 2020

@jeremija I'm going to disable completion results that add import lines by default, which will match what ALE does with tsserver. You can get a lot of surprising completion results that way, and it will take longer to search a whole project for imports instead of just the current file, for many servers. Use let g:ale_completion_autoimport = 1 after I push my patch in a moment to turn it on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add autoimport support for LSP linters

2 participants