-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Ability to extract Svelte HTML into a component #187
Comments
* (feat) extract component refactoring #187 * (feat) extract component now with prompt for path/name - Is no longer part of the getCodeActions now, which might also improve performance a little * tests * docs * lint * (feat) update relative imports
This now exists (for a while) to some extend. Here's what you need to do:
What's missing:
|
Thanks for the heads-up!! When I saw the initial PR, my immediate impulse was to try right-clicking. It didn't work, so I assumed it just hadn't shipped yet, and I forgot about it for a while. This was based on my expectations from extracting/refactoring support in JavaScript. Did you consider implementing this via the context-menu? |
Hi, I wonder if it's possible to have this functionality in the native LSP protocol code actions? |
It'd be nice to get the ability to extract sections of HTML into a separate component through a context-menu. For example, if I select a
div
and right-click, it should give me the option to extract it into a separate component.Example extracting an expression to a variable VSCode:
☝️ I essentially would like to be able to do that with HTML, not just JS.
I've used @proverbial-ninja's vscode-component-extractor which is very handy for simple refactors.
But for more complex examples, understanding the Svelte's compiler's output is necessary. eg:
I'd like to select
div.one
> Extract to component and end up with:The text was updated successfully, but these errors were encountered: