cmstead / js-codeformer

A JS refactoring and code automation tool for building better source
MIT License
28 stars 1 forks source link

Combine built in refactorings with this extension's #27

Open dudeNumber4 opened 2 years ago

dudeNumber4 commented 2 years ago

Is there any way to combine this extension's actions (invokable via ctrl alt .) with VS Code's built on ones (invokable via ctrl .)?

cmstead commented 2 years ago

I have a couple thoughts on this, which impacts the decision.

TL;DR -- this is a complicated topic that requires a lot of careful thought and discussion.

Anyway, the long version:

Incorporating JS CodeFormer actions into the code actions menu

I was originally exploring this, however I hit a big roadblock. There are some cases where the extension would be disabled (like Live Share sessions) which means people who are used to having the tools available would experience a significant impairment while working.

Code actions also require constant evaluation of the source code. That means it could impact the performance of JS CodeFormer, especially on older, slower machines.

Incorporating the VS Code built-in behaviors

I can incorporate some into the list I generate, but I will need a list of the ones people want to see. Incorporating everything would add a significant amount of noise.

dudeNumber4 commented 2 years ago

I can incorporate some into the list I generate, but I will need a list of the ones people want to see. Incorporating everything would add a significant amount of noise.

The default list of refactorings in VS Code is almost nothing, and almost worthless. Is the noise you refer to noise from many other potential extensions?

cmstead commented 2 years ago

Maybe I am mistaking options which are coming from extensions as being part of the default set. I honestly lose track of it.

So, you're really looking for options from this tool in the code actions menu (aka the lightbulb menu). I may create a separate extension which acts as an add-on for this which would place all of the options in the code action menu. The core reasons I didn't add code actions into JS CodeFormer is largely due to Live Share sessions disabling all code action options.

Anyway, would a decorating extension be interesting to you?

dudeNumber4 commented 2 years ago

Yes, I think that's what I was originally requesting. As for live share disabling options, I think that would be acceptable; live share has many limitations, right?

cmstead commented 2 years ago

Live Share does disable a number of things. That said, I actually removed code actions because the disabling was not alright for me or many other users.

Would a decorating extension be interesting to you that just enables code actions? I would make the the method for installing the supporting extension part of the documentation for this extension.

dudeNumber4 commented 2 years ago

Yes, that would be great!