-
-
Notifications
You must be signed in to change notification settings - Fork 594
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: Add rename symbol support #610
Comments
Yeah, I deferred this since making sure it works for templates too can be a bit of work. For example, renaming a data attribute should replace all its occurrences in interpolations, renaming |
I pushed a commit that does js rename. If you have // foo.js
export const foo = 1 <script>
import { foo } from './foo.js'
</script> Renaming on JS inside the Vue file works fine, renaming on the JS file does not propagate the changes to JS. To achieve that, we probably need a TS plugin. However, I'm not sure how it can communicate with Vue Language Server and get the edit location. |
Any updates on this issue? Would it be possible to enable working parts as, for example, experimental flags? |
I would try this. Any help would be welcome. |
I wondered about why this was not implemented, and only when I read this thread did I realise the full complexity. There are several levels at which it could be implemented, with increasing levels of programming difficulty and increasing value. Even the simplest level could be useful. Level 1. Level 2. Level 3. If Level 1 (or 1 and 2) are attainable at modest effort, it would be really worthwhile, and I would use it -- and be thankful! |
Dear @octref, |
Renaming symbols have been working great at least for year in vuejs plugin for IntelliJ Idea (https://github.com/JetBrains/intellij-plugins/tree/master/vuejs). |
@octref How feasible would it be to implement level 1 in vue-language-server? I'm using VSCode at work but the rest of them use WebStorm and it's becoming more attractive all the time... |
I'm looking forward to this one too. Any ETA on this? |
Truth is I've been using WebStorm for the last week and I gotta say while VSCode is a way better editor, WebStorm is SO much better in terms of Vue support. Just finished a big refactor where I've been changing file names, moving file paths, renaming variables, changing types, etc. and WebStorm does it all automatically. Fixes everything including tests and documentation. I switch back and forth between VSCode and WebStorm every other day because I find editing in WebStorm to be awful, and truth is Vetur is REALLY good, and nearly everything I need or want Vetur can do, but there are occasions when I need more power and WebStorm provides that stunningly. edit: not just renaming and moving, but things like extracting components into separate files, a really cool graph feature that you can right click on a component and it will show a cool graph of all the components linked to it, inline css previews and pickers, method parameter decorations (that's a VSCode vs. WebStorm thing though, not Vetur), are some more things I've noticed in the last week |
Any updates on this issue? |
@heavenkiller2018 |
tracking this issue 👀 |
Please implement this it would be so helpful! |
Hi there 👋 I recently mentioned that I adapted one of my extension that brings automated refactorings so it works with "Rename symbol" is an essential refactoring (the most essential?). The extension used to delegate that to VS Code because it does a very good job. But I realized it wasn't supported for Vue files! So I worked on that yesterday and I'm happy to say that I've shipped a change today (v4.11.0) to support renaming symbols in The UX is similar to the one you'd have with VS Code (although I didn't managed to get the input box just below the symbol). It's seamless since you trigger that with I hope that could help you until this is supported by Vetur directly 👍 (it's getting there, but supporting automated refactorings isn't something easy to implement and takes time!) |
After those days, I've rewritten my project to React |
Any updates, or alternative extensions that work at the moment? |
@JoJk0 Depending on your needs you may have a look at VueDX, Volar or Abracadabra It is really confusing at the moment with different extensions and approaches, each with their own pros and cons. |
It would be great to have it at least in the HTML part... |
I believe there's already an issue for this, but unfortunately Abracadabra doesn't work inside the |
Renaming HTML tag is another issue. #565 |
@deisner indeed, Abracadabra will only work in the |
@octref Do you have any plan here? |
I reinstalled my editor several times because I thought there was something wrong with it :( |
No rename option here still? |
I just found VueDX extension. https://marketplace.visualstudio.com/items?itemName=znck.vue-language-features Seems great, and working great so far! |
Bump. There's still no rename feature. |
@tokiory Maybe give volar a try, it‘s recommended in the vue docs and supports renaming of symbols (in TS projects at least) |
Problem
Language Server Protocol supports rename request.
Open question: should rename symbol change all related symbols in different language sections?
For example, change a component name should almost always change the component name in template as well.
The text was updated successfully, but these errors were encountered: