Skip to content
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

Implement renaming symbols via LSP and tsserver #1519

Closed
w0rp opened this issue Apr 23, 2018 · 11 comments
Closed

Implement renaming symbols via LSP and tsserver #1519

w0rp opened this issue Apr 23, 2018 · 11 comments

Comments

@w0rp
Copy link
Member

w0rp commented Apr 23, 2018

LSP and tsserver support operations for renaming things, and ALE should support these operations.

@w0rp w0rp removed the LSP Any issue relating to LSP or tsserver label Apr 23, 2018
@wavded
Copy link

wavded commented Sep 25, 2018

This would be super handy to have. Any plans still @w0rp ? I would prefer to just use ale than have another lang server plugin that supports this.

@w0rp
Copy link
Member Author

w0rp commented Sep 27, 2018

The plan is to just eventually implement it somehow.

@eugene-bright
Copy link

LanguageClient-neovim implements this feature. It's a subject to some 'code sharing'.
autozimu/LanguageClient-neovim#35 (comment)

@w0rp
Copy link
Member Author

w0rp commented Jan 10, 2019

It sure does. It's not ALE. I'll implement this eventually, or someone else can try.

@eugene-bright
Copy link

May we get the feature by low price by passing LSP connection to LanguageClient-neovim functions? Raw ugly but possible working idea.

@w0rp
Copy link
Member Author

w0rp commented Jan 10, 2019

Sure, I already implemented support so that other tools can give diagnostics to ALE, for ALE to render. See :help ale-lint-other-sources. Someone can either add support for ALE to LanguageClient-neovim, or someone can implement a plugin that bridges the two. ALE itself won't ever implement support for some other language server plugin, and it doesn't have to.

@mwilliammyers
Copy link

mwilliammyers commented Feb 16, 2019

I have an old commit that adds support for the lsp and tsserver renaming protocols and (most likely not working) support for performing the actual renaming in vim.

I can open a work in progress PR (I most likely won't have a ton of time to work on this for a while...) or someone is welcome to use my commit as a basis to finish it off.

@w0rp
Copy link
Member Author

w0rp commented Feb 17, 2019

Thank you for sharing that. Someone might pick it up and finish the job. 👍

@Risto-Stevcev
Copy link
Contributor

I tried getting this to work a while back but it doesn't seem to rename anything:
Risto-Stevcev@a94bf9b

This is such a critical IDE feature, it would be nice to get this in

@jeremija
Copy link
Contributor

jeremija commented Aug 14, 2019

I made rename work for TypeScript by continuing off of @mwilliammyers's work (thanks!). It's on my fork on the feature/renaming-symbols branch. Here's the link to the main commit. I also merged upstream/master into it to keep it up to date.

Since I changed the message structure in ale#rename#HandleTSServerResponse (that eventually gets passed on to s:ApplyRenameEdits), it also needs to be changed in ale#rename#HandleLSPResponse.

Also, the way the buffer contents get replaced seems hackish as hell - I'd appreciate if somebody could suggest a better way to do it :)

@w0rp
Copy link
Member Author

w0rp commented Sep 20, 2019

:ALERename has been merged already now.

@w0rp w0rp closed this as completed Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants