-
Notifications
You must be signed in to change notification settings - Fork 255
[Feature request] Update imports for the file after file is renamed #623
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
Comments
I have been using the technique linked to in this comment: #308 (comment) It works great for me. I'm sure you can adjust that for other languages. |
Sorry, wrong button. I didn't mean to close it! |
Nice solution, but I think that only works for typescript.
Here is my implementation that works with But that needs changes in |
OK, I see. If you wanted to add the new event I would accept that as a PR. I think this would be the callback point:
|
Not sure I understand what "callback point" means - is it an event with a callback? |
It would also probably be a good idea to add similar events for Let me know if you think this should be opened as a new issue for a feature request or if here is more succinct rather than opening new issues. Thanks for the initial |
@mehalter it definitely should be a new issue to add the new events. |
Problem:
I am using this plugin for file rename/move operations. I would want to integrate these operations with LSP. Some LSP servers support functionality to update imports after the file is renamed or moved. Client sends workspace/willRenameFiles notification to LSP, which returns import changes. dartls supports this notification. I want a hook to file rename flow to be able to call LSP and apply returned results.
Possible implementation:
It would be nice to be able to setup this hook in neo-tree, possible implementation:
https://github.com/nvim-neo-tree/neo-tree.nvim/compare/v2.x...sidlatau:neo-tree.nvim:update-imports?expand=1
Then user needs to setup this hook:
where data is:
Alternatives tried:
I tried to use events infrastructure in
neo-tree
, added newWILL_FILE_RENAME
event, but problem with them is that they does not block a flow. When request reaches LSP about renamed file, server returns empty results, I suspect file is already renamed and server does not see it. In above provided solution I can control when actual rename occurs.I think several such hooks could be useful - for file rename, file move, maybe even for operations with folders.
Would it be feasible to add such hooks to
neo-tree
?I may create PR then.
The text was updated successfully, but these errors were encountered: