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

WIP for LSP "rename symbol" #689

Closed
wants to merge 1 commit into from
Closed

WIP for LSP "rename symbol" #689

wants to merge 1 commit into from

Conversation

rasa-silva
Copy link
Contributor

Like the title says.

The server is currently giving and error of Invalid params: No references found at position which I don't understand why...
I also notice a off-by-one mismatch between the line/col reported by Helix and the ones mention on the LSP server response...?

Still missing:

  • Apply the WorkspaceEdit result from the server into the workspace.
  • Probably coding cleanups since my knowledge of Rust is primitive...

@rasa-silva rasa-silva closed this Aug 31, 2021
@rasa-silva rasa-silva reopened this Aug 31, 2021
@archseer
Copy link
Member

archseer commented Sep 1, 2021

I also notice a off-by-one mismatch between the line/col reported by Helix and the ones mention on the LSP server response...?

LSP uses 1-indexed lines, we use 0-indexed lines. lsp_pos_to_pos takes care of this. I didn't realize this uses WorkspaceEdits, we'll need to add some utilities for dealing with those (right now only generate_transaction_from_edits exists for TextEdits).

Looks like it's not too hard to implement, besides edits there's a few commands to create/delete/rename files: https://github.com/kak-lsp/kak-lsp/blob/4f24f0f1cb3689d86d68e0463ab0f191a8166ba1/src/workspace.rs#L138-L241

@archseer archseer mentioned this pull request Nov 7, 2021
@sudormrfbin sudormrfbin linked an issue Nov 7, 2021 that may be closed by this pull request
@archseer
Copy link
Member

archseer commented Nov 9, 2021

This was implemented in #1011

@archseer archseer closed this Nov 9, 2021
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.

rename a function
2 participants