sublimelsp / LSP-typescript

TypeScript, JavaScript support for Sublime LSP plugin
MIT License
135 stars 11 forks source link

Feat: Rename imports #119

Closed predragnikolic closed 1 year ago

predragnikolic commented 2 years ago

When we rename or move a file, the user is prompted to rename all imports.

This PR also adds a new setting updateImportsOnFileMove with the following options "prompt", "always", "never".

output

predragnikolic commented 2 years ago

Notes:

rchl commented 1 year ago

Quite a lot of work was put into it but ultimately I don't think that this is the way to go. It would not be fine to trigger disrupting rename prompts whenever something would be renamed. Renames should only be handled by the server when user explicitly asks to rename some file so we need LSP-specific rename actions instead.

Maybe if there would be a way to offer the user suggestion to update imports in a non-distracting way then it would be more acceptable but it might be better to just only do that on explicit request to rename.

predragnikolic commented 1 year ago

Agreed, I will close this PR.

I saw the willRename PR on the ts server repo. I believe that is the way to go.