-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Extension not working for .vue files #133
Comments
Thanks for pointing this out 👍 It would be cool indeed to handle <template>
<div id="app">
<h1>My Todo App!</h1>
<TodoList/>
</div>
</template>
<script>
import TodoList from './components/TodoList.vue'
export default {
components: {
TodoList
}
}
</script>
<style lang="scss">
@import './variables.scss';
*, *::before, *::after {
box-sizing: border-box;
}
#app {
max-width: 400px;
margin: 0 auto;
line-height: 1.4;
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: $vue-blue;
}
h1 {
text-align: center;
}
</style> We currently parse the source code with babel here: abracadabra/src/ast/transformation.ts Lines 104 to 150 in ebb2f9e
This creates an AST we traverse and modify to refactor the code. Unfortunately, it doesn't work with |
Had a call with @OliverJAsh today and we discussed a way to solve that elegantly:
|
@all-contributors please add albertoxamin for ideas |
I've put up a pull request to add @albertoxamin! 🎉 |
@albertoxamin this is now implemented 🎉 It will be part of the next release, which I planned to do next week. I'll let you know when it's out. |
Heads up @albertoxamin! This has been released with v4.8.0 🎉 Let me know if you run into troubles! |
Rename Symbol works fine with .js files but not with any .vue files. Other refactorings do work, but not Rename. Are there any settings I must activate for it to work? |
@leosdad yep, I realized that too. The reason is that Abracadabra's rename just fallbacks on VS Code's rename 😅 abracadabra/src/refactorings/rename-symbol/rename-symbol.ts Lines 5 to 8 in 04fa63e
It usually works very well. But turns out it doesn't work on Vue files. I don't know how difficult it would be to implement. I think it wouldn't be trivial, but that could be an interesting one. I can see that the issue has been closed in VS Code (microsoft/vscode#108854) and is still open in Vetur (vuejs/vetur#610) We have other issues planned, but if that's important for you feel free to open an issue for this @leosdad. I think we could delegate to the editor and fallback on a custom implementation if it's not supported. Main logic would be to capture user input, find all other identical identifiers in scope and overwrite them with the new name. |
Too bad, I've installed Abracadabra in the hope it would solve this very limitation. Vue is still way behind other frameworks in terms of tooling in VS Code -- Vetur has several limitations and it's not evolving very much AFAIK. I'll start using your extension anyway, seems to be better than other ones I've tested and it's being actively developed. I'll sure open an issue for this now. Many thanks for your detailed answer. |
Is this request related to a problem? Please describe.
The extension does not work for vue files that contain both html/pug and js
Describe the solution you'd like
I would like the extension to recognize .vue files as js files
The text was updated successfully, but these errors were encountered: