vscode-deck icon indicating copy to clipboard operation
vscode-deck copied to clipboard

Feature Request: Context Aware actions

Open corbob opened this issue 3 years ago • 4 comments

It would be really really cool if the buttons could be made context aware... For instance, I'd love to have commands that only fire if the language is PowerShell. Something akin to the Keyboard shortcuts that change based on the state: image

corbob avatar Sep 13 '20 02:09 corbob

Yep I agree this would be very cool - as would commands that vary depending on the state. For example, running workbench.action.debug.start if isDebugMode==false, or workbench.action.debug.continue if isDebugMode==true

piersdeseilligny avatar Nov 01 '20 14:11 piersdeseilligny

Hey @corbob, @piersdeseilligny

Sorry for the late reply got busy finishing other projects.

Despite not replying I've taken some time before them and now and couldn't find any way to access the "context-aware" from VS Code. It's not public in the VS Code extension API.

The only way this will be possible is by implementing based on stuff that we could access trough the extension API.

Like both of you suggested the "debug aware" is something possible. Could you think other contexts that maybe be useful, so that I could consider if it's worth implementing besides the API limitations?

There's another approach that may be possible is using VS Code tasks which can access the context-aware.

nicollasricas avatar Dec 21 '20 14:12 nicollasricas

I feel like "debug aware" and "language aware" would already allow for some pretty powerful features - especially if the streamdeck image can be customized in each state. It might be good to add support for that and then see if anyone requests something more specific?

piersdeseilligny avatar Dec 21 '20 20:12 piersdeseilligny

I don't understand much from the VSCode API but it seems that the current language could be obtained from the TextDocument, am I wrong? Also, I believe that the current debug state could be achieved via debug.activeDebugSession != undefined.

marcoaaguiar avatar Oct 24 '22 14:10 marcoaaguiar