-
-
Notifications
You must be signed in to change notification settings - Fork 590
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
Feature Request: Update import paths when a file is moved/renamed #820
Comments
+1 I don't use refactoring tools much in general, but this one saves so much time. I'd be happy to take a stab at it with a PR if someone on the vetur team would weigh as to whether it's easy to implement. Note that I have never looked at the vetur source before so I'd be starting from scratch. An even more amazing variant on this would be the ability to select a block of HTML from |
@hmexx If you are interested in contributing, you can get started by reading https://code.visualstudio.com/docs/extensions/example-language-server and https://github.com/vuejs/vetur/blob/master/.github/CONTRIBUTING.md. I'm planning to add more contribution docs for Vetur over the weekend. However, this particular one is very involved. To do it correctly you need to handle cases of both moving TS/JS files (which Vue files can import), and moving Vue files. I suggest starting with something simpler like this: #780 |
What I found out:
|
@hmexx It would be great if you can open a new issue to track the rafactor support. I would want it too. It would be great to start with clear definition of the expected input, the action and the expected output. |
Any update for this? |
The fact that this feature is still not implemented makes VS Code inferior to WebStorm, thus making Vetur quite useless. I would like to use VS Code (with Vetur) when developing Vue.js applications but this feature is a deal breaker. I move components around or rename them basically every single day since applications are constantly evolving. And I cannot imagine searching for all the files where those components were used and manually changing imports everywhere each time I make such change. There can easily be 10s (or sometimes even 100s) of places where those components are used in larger applications. I have seen it in multiple projects that because of such basic features missing in such important tools (as Vetur is) developers are reluctant to refactor existing code which results in applications getting into quite bad shape. And that leads to worse developer experience as well as decreased productivity. I think having this feature in Vetur is crucial to making VS Code and Vue.js good tools for implementing large-scale applications. |
The LSP 3.16 brings |
Welcome PR. 👍 |
I have enabled the settings in vs code, "Update Import On File Move" but still it does not work for
Is there any extra configuration that needs to be added? It works when importing using the relative path ../../../** jsconfig.json
Thanks |
same issue for me, we use '@/components/....' and moving a file from '@/views/...' into the components folder has no refactoring effect triggered in the code base |
+1 with vscode and vue3 @/... import. |
Same issue here. |
Feature request
Code recently released a feature to update import paths when a Typescrip/JS file is moved or renamed. It would be absolutely amazing if Vetur could support that feature in SFCs!
The text was updated successfully, but these errors were encountered: