Skip to content
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

Update imports when filename changes #410

Closed
Tracked by #879
David-Else opened this issue May 3, 2021 · 4 comments · Fixed by denoland/deno#17979 or denoland/deno#20245
Closed
Tracked by #879

Update imports when filename changes #410

David-Else opened this issue May 3, 2021 · 4 comments · Fixed by denoland/deno#17979 or denoland/deno#20245
Labels

Comments

@David-Else
Copy link

Is your feature request related to a problem? Please describe.
Using the TypeScript server when I rename a file all the imports in different files update to reflect the change. There is no need for a `.tsconfig', it just works out of the box.

Describe the solution you'd like
It should happen when using deno LSP.

It does not work in VS Code or Neovim LSP. I know there is a problem making it work in Neovim with the standard TypeScript server as someone has written this workaround: https://github.com/jose-elias-alvarez/nvim-lsp-ts-utils

  • Rename file and update imports (exposed as :TSLspRenameFile)

One of my most missed features from VS Code / coc.nvim. Enter a new path (based on the current file's path) and watch the magic happen.

I hope the Deno solution will work in both editors. Neovim has deno LSP additional functions added here: https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#denols

@kitsonk kitsonk added the enhancement New feature or request label May 3, 2021
@scarf005
Copy link

scarf005 commented Feb 14, 2023

hi, this issue was around ~2y, and i wonder if this issue could be given a higher priority.

as OP mentioned, being able to update imports out of the box is a huge DX improvement. for example, changing location of a single file could involve updating import path for tens of files.

it'd be great to know if

  1. this issue is considered for deno devteam
  2. there are any hardships related to resolving this issue.

thanks in advance.

EDIT:
after searching a bit more, sort of self-answered them:

  1. it is planned in 1.30 to implement import updating for lsp in Feature Request: Auto path import update deno#14316
  2. vscode_deno team could begin after waiting until said lsp feature to be implemented.

@haschu
Copy link

haschu commented Apr 16, 2023

Hey!

This issue has been closed by this PR, which is already part of the latest release, but imports are still not updated when a filename or directory name is changed - or am I missing something?

@yacinehmito
Copy link

@dsherret I am wondering the same as @haschu. How can we benefit from this?

@bartlomieju
Copy link
Member

This appears to be the same issue as #692

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
7 participants