nicollasricas / vscode-deck

Enables Stream Deck integration with Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=nicollasr.vscode-streamdeck
MIT License
82 stars 13 forks source link

Feature Request: Context Aware actions #14

Open corbob opened 4 years ago

corbob commented 4 years ago

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

piersdeseilligny commented 4 years ago

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

nicollasricas commented 3 years ago

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.

piersdeseilligny commented 3 years ago

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?

marcoaaguiar commented 2 years ago

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.