smjonas / inc-rename.nvim

Incremental LSP renaming based on Neovim's command-preview feature.
MIT License
637 stars 8 forks source link

feat: add option to fetch references synchronously #21

Closed smjonas closed 1 year ago

smjonas commented 2 years ago

@weilbith Could you check out this branch? Do you think this is too laggy? (I might be able to add some sort of caching to speed things up when repeatedly fetching references for the same variable but obviously I can't speed up the LSP server). Btw, I even got Neovim to crash when the LSP server has timed out :smile: So it doesn't seem that stable.

To enable this feature, add the following to your setup:

require("inc_rename").setup {
  async = false,
}

Let me know what you think!

Closes #20.

smjonas commented 1 year ago

Hey @weilbith, hope you're doing well :) I just thought I'd ping you regarding this PR in case you missed the GitHub notification. I understand if you're busy though, so no rush! I'm curious about your feedback.

weilbith commented 1 year ago

Hey. I'm very sorry for the delay! Thank you so much for making a PR so fast. I tested it now and I must admit that it doesn't work for me. 😕 I'm getting the error message: ERROR [inc-rename] Error while finding references: timeout.

EDIT: I tried it with the typescript-language-server if that helps you.

smjonas commented 1 year ago

No worries at all! That error is actually expected if the LSP server hasn't started up yet. I don't know if it would be best to increase the timeout specifically for this request. It can actually take a few seconds until the server is ready.

weilbith commented 1 year ago

You are right. Now it works. I'm confused. Anyway. So the highlight appears immediately. But my dressing.nvim input window does not. 🤔