PowerShellEditorServices icon indicating copy to clipboard operation
PowerShellEditorServices copied to clipboard

Add $psEditor API for adding context menu commands

Open daviwil opened this issue 7 years ago • 5 comments

It seems that VS Code is adding new extension points to add context menu commands:

https://github.com/alexandrudima/vscode-copy-relative-path/blob/master/package.json#L24

It would be cool to allow $psEditor extensions to add new commands there as well.

daviwil avatar Sep 07 '16 14:09 daviwil

$psEditor all the things 😄

TylerLeonhardt avatar Jan 13 '18 00:01 TylerLeonhardt

Definitely still worth doing, but I dunno if you can dynamically register context menu items. VS Code likes to have everything statically registered in the package.json, so it may not be possible. Needs investigation.

daviwil avatar Jan 13 '18 00:01 daviwil

Something I've been wanting for a long time is the ability to assign an AST type to an editor command so any time you right clicked within an AST of that type you'd have the option to invoke it. Last time I looked into implementing it (a few months ago) it wasn't possible 😕

SeeminglyScience avatar Jan 13 '18 12:01 SeeminglyScience

Whoaa that'd be awesome @SeeminglyScience. Was VSCode not sending click events to PSES? Or rather click events at a particular context?

TylerLeonhardt avatar Jan 15 '18 08:01 TylerLeonhardt

@tylerl0706 I don't think we send any events that generic to PSES, but more importantly you just couldn't register context menu items dynamically period. They all need to be define explicitly in the package.json file. I didn't get far enough into looking into it to know for sure, but even if that's changed since then it seemed like the when clause didn't provide enough control for that either.

SeeminglyScience avatar Jan 15 '18 11:01 SeeminglyScience