js-codeformer icon indicating copy to clipboard operation
js-codeformer copied to clipboard

Combine built in refactorings with this extension's

Open dudeNumber4 opened this issue 3 years ago • 6 comments

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

dudeNumber4 avatar Oct 26 '21 20:10 dudeNumber4

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.

cmstead avatar Nov 04 '21 18:11 cmstead

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?

dudeNumber4 avatar Nov 08 '21 17:11 dudeNumber4

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?

cmstead avatar Nov 15 '21 22:11 cmstead

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?

dudeNumber4 avatar Nov 16 '21 15:11 dudeNumber4

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.

cmstead avatar Nov 16 '21 17:11 cmstead

Yes, that would be great!

dudeNumber4 avatar Nov 17 '21 03:11 dudeNumber4