-
Notifications
You must be signed in to change notification settings - Fork 13
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
Does this extension depend on built-in typescript/javascript extension? #39
Comments
Hello @xsburg , thanks for your answer. And this is what happens if I select that extra last line: Quite a difference right? I guess the "parser" needs the entire context to know to which codemod dispatch the action. And talking about codemods...I re-read the options more carefully and I saw an option called "codemods-directory". Is that right? Can I run my own codemods from this extension? |
Actually, most of the code actions provided by this extension (all of them except one) are activated by the position of the cursor, not by selecting a code fragment. Normally they are easy to discover, e.g. "Split into declaration and initialization" appears when you put the cursor somewhere around the assignment ( Speaking about your particular example, some of the actions that you see on the last image are actually provided by TypeScript itself and indeed are selection based. The rest, provided by the JavaScript Booster, are appearing because the cursor is located at the right place (the selection itself is not taken into account). Regarding running your own code mods, that's correct. You can put 👋 |
Ok, that makes the plugin a bit sensitive to my taste. When I install a plugin I just give a quick read to the docs and expect to get the functionality in a "organic" way, and this kind of very narrowed activating makes that a bit hard for me. I think the concept of the extension is very awesome, and I really like having it, but I have the feeling that I didn't used much because of this. Also not being able to trigger any of this actions (I think this is a VSCode problem) from the command palette frustrates me a bit. I will be trying the codemod feature with some code-mods that I have already used. I will just put the folder on the config and see what happens. Regards |
Just pointed the extension config option to a folder containing codemods, but I don't see how can I execute them. Any hint? |
1 similar comment
Just pointed the extension config option to a folder containing codemods, but I don't see how can I execute them. Any hint? |
There are two kinds of code mods supported: global and cursor-based. The global code mods are accessible through the "Run global code action" command, while cursor-based will appear in the action bulb based on the logic defined in the |
Because you said that any normal codemod can be used I just tried with some that I already have for my personal use.
I guess that those extra properties are a requirement for the codemod to show up on the list of global ones? So what is the bare minimum to get a global codemod to show ? title and scope? |
Hello,
I have this extension installed and I can not trigger any codemod, not from the context menu (there is no bulb icon when I select an arrow function) nor from the command pallete.
I have the built-in typescript javascript extension disabled, does that affect this extension?
The text was updated successfully, but these errors were encountered: