Description
Summary of the new feature
As a writer of a PowerShellEditorServices extension I want to enable users to install a vscode extension containing my module.
I need that extension to be able to:
- Use the integrated console to install the module from the gallery, or provide an additional
PSModulePath
- Import the PSES extension module on vscode extension activation
I want that extension to be able to:
- Register new requests and notifications that PSES would redirect to my module
The current install process is as follows:
- Install the module manually from the gallery
- Add an
Import-Module
statement to your profile - Manually add keybinds to
keybinds.json
(using syntax you can only determine from reading vscode-powershell's source or a posted example)
That's a lot to ask of folks just to try out a module.
Proposed technical implementation details (optional)
The getExtension function allows vscode extensions to acquire a public API from another extension. This API would need to be surfaced by vscode-powershell internally, and optionally (though ideally) a typescript type definition would also be published to npm.
The bare minimum needed in this API would be an exported function that just imports a module from a path. Something like:
tryImportPowerShellModule(path: string) => bool
Edit: Actually a simple import function would be pretty inconsistent since it would be lost every time the console was restarted/version changed. Maybe something like:
registerPSESExtensionModule(path: string) => void;
Where vscode-powershell internally tracks registered modules and reimports them at startup.