rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 94 forks source link

Fast initiation of renaming misses all other occurrences #385

Closed letmaik closed 5 years ago

letmaik commented 5 years ago

When I click on an identifier and very quickly (via keyboard shortcut) initiate the renaming, then it may happen that the other occurrences are not highlighted/detected yet and it will only rename the identifier under the cursor. This leaves the file in an inconsistent state.

rikvdkleij commented 5 years ago

Thanks for reporting!

I also sometimes experience that problem, especially when Haskell module is large.

Loading the module takes some times in the REPL and during that loading the REPL is not available for other requests like asking for location info of a identifier.

Can not do much about that. Plugin tries to cache as much as possible (but can take a look again). Final solution is to use Haskell backend which can handle concurrent requests.

letmaik commented 5 years ago

Isn't there a way to delay the start of the renaming action so that it waits until the REPL is ready and gave an answer?

rikvdkleij commented 5 years ago

Just noticed that there is already a simple check if REPL is not busy before renaming. But it also has to check that all needed references are already known. But how does IntelliJ know that 😄

Will think about a solution. Maybe some preloading of definition location info...

rikvdkleij commented 5 years ago

I think I found the cause of this issue. Also for #384

When the fix is okay then it should be fixed in next beta.

Edit: I mean, I will do some more testing.

rikvdkleij commented 5 years ago

Please reopen when it's still an issue.