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
Refactor/code action "Move to a new file" has stopped working #501
Comments
Are you able to provide some LSP communication logs from the editor? |
Sure! https://gist.github.com/ajitid/381c5082f3ec7064bb14ea51175c6f2c. The log mentions |
Thanks. Seems like server returns changes with wrong range (-1):
To which the editor responds with an error:
Should be fixable. |
It's potentially something that has changed/broke in some version of Typescript and could be reported in its repo but it should still be handled here, of course. |
Sublime LSP also uses this package, right? How come it is able to handle this code action just fine? |
Likely because it's clamping the values which makes the start and end range correctly point at 0, 0 Spec defines |
Typescript appears to be sending 0, 0 ranges when providing edit for creating new file, even though the positions are supposed to be 1-based. Fixes #501
I've seen this broken behavior in two editors — Neovim and Zed. It certainly used to work before.
This code action appears if you select a function and invoke a range code action. It used to create a new file and move the function along with the imports/references to this new file.
Current behavior: It creates a blank new file and
doesn'tmight not make any code changes to the current file.The text was updated successfully, but these errors were encountered: