inc-rename.nvim icon indicating copy to clipboard operation
inc-rename.nvim copied to clipboard

feat: add option to fetch references synchronously

Open smjonas opened this issue 3 years ago • 4 comments

@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 avatar Sep 13 '22 14:09 smjonas

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.

smjonas avatar Sep 15 '22 15:09 smjonas

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.

weilbith avatar Sep 16 '22 06:09 weilbith

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.

smjonas avatar Sep 16 '22 08:09 smjonas

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

weilbith avatar Sep 16 '22 12:09 weilbith