PowerShellEditorServices
PowerShellEditorServices copied to clipboard
Add $psEditor API for adding context menu commands
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.
$psEditor all the things 😄
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.
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 😕
Whoaa that'd be awesome @SeeminglyScience. Was VSCode not sending click events to PSES? Or rather click events at a particular context?
@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.