p42ai / js-assistant

120+ refactorings and code-assists for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=p42ai.refactor
MIT License
119 stars 7 forks source link

Please return the "Move up/down" commands #55

Closed Lippiece closed 1 year ago

Lippiece commented 1 year ago

I couldn't even find the reason they were removed. I've been using them all the time!

lgrammel commented 1 year ago

Thanks for the bug report!

How have you been invoking the commands? (the code assists are still be there, but some ways of invoking them have changed in v1.152 in preparation of the upcoming VS Code 1.72 release)

lgrammel commented 1 year ago

In case you have been invoking the commands from a custom keyboard shortcut, the recommended way now is to set up the keyboard shortcut to the code actions directly, e.g.:

{
    "key": "Ctrl+Up",
    "when": "editorTextFocus && resourceExtname =~ /^(\\.js|\\.jsx|\\.cjs|\\.mjs|\\.ts|\\.tsx|\\.cts|\\.mts|\\.vue)$/",
    "command": "editor.action.codeAction",
    "args": { 
        "kind": "refactor.move.up",
        "apply": "ifSingle"
    }
}
Lippiece commented 1 year ago

This was fine while it lasted.

image

Is there any easy way to just use the move up and down commands?

lgrammel commented 1 year ago

@Lippiece yes - you can use version 1.165.2, or even better, the one with the commands (1.151.0).

There is also Abracadabra, which offers move statement commands: https://github.com/nicoespeon/abracadabra/blob/main/REFACTORINGS.md#move-statement-up

Lippiece commented 1 year ago

@Lippiece yes - you can use version 1.165.2, or even better, the one with the commands (1.151.0).

There is also Abracadabra, which offers move statement commands: nicoespeon/abracadabra@main/REFACTORINGS.md#move-statement-up

Abracadabra can't move statements half of the times.

So you've just removed this functionality and not going to bring it back, is that correct?

lgrammel commented 1 year ago

The functionality is still there - what you are seeing is a result of the change of the pricing model. Sadly, the freemium model of the P42 JS Assistant extension with a Free and a Pro plan has not been sustainable, and I have bills that I need to pay (I'm working on P42 full time).

Therefore, starting with version 2.0, the P42 JS Assistant extension requires a subscription. The Free plan is no longer available.

If you want to keep using the free features without upgrading, you can continue to use the JS Assistant v1.165.2, which will remain available in the marketplace.

If you want to purchase P42 Basic, you can use the UPGRADEV2 coupon code and get a 20% discount. It applies perpetually and is valid until Nov 30, 2022. You can enter the coupon code in the purchase checkout.