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:
PSModulePathI want that extension to be able to:
The current install process is as follows:
Import-Module statement to your profilekeybinds.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
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.
I guess today you could throw your module into the bundled module path as a workaround.
I thought we originally had a setting that forced importing modules (via paths) into the session at start up but Omnisharp transition might have dropped that.
Yeah that's something. That would at least take away the burden of updating away from the user. Not sure if that's an implementation detail we'd want to encourage folks to depend on though.
Also that, and also the setting to force imports (if we have/had it) would have a lot of timing issues. Especially if both extensions are starting, and mine needs to update or something. Ideally it would be something the PSIC could also handle after initialization.
Yeah that's something. That would at least take away the burden of updating away from the user. Not sure if that's an implementation detail we'd want to encourage folks to depend on though.
Totally agree. Just wanted to unblock you at least since I'm not sure when we'll have the time to do this work. 馃槄 Plus, when has an implementation detail stopped you in the past 馃槈
Totally agree. Just wanted to unblock you at least since I'm not sure when we'll have the time to do this work. 馃槄 Plus, when has an implementation detail stopped you in the past 馃槈
A whole lot more these days 馃槢 Now if it worked without timing issues and saved the user from having put something their profile... that'd be a different story 馃檪
If we all agree this is desired then I'll implement it.
Thanks @SeeminglyScience, can you clarify briefly what APIs you are planning to implement? Feel free to open a PR :smile:
I believe it is very important that features like those in EditorServicesCommandSuite be addable as extensions. Some of that functionality is incredibly important to powershell development, and the vast, vast majority of users are probably completely unaware of its existence. Heck, everyone I know that uses it found out about it from twitter, or by wishing features existed and googling it and finding https://sqldbawithabeard.com/2018/03/11/easily-splatting-powershell-with-vs-code/
Ease of discovery, ease of use, reliability are all lacking here, and having better extension support (and better keymapping support, ideally) should improve discovery and ease of use. The number of users using EditorServicesCommandSuite is probably abysmally small compared to the number of users that would benefit from it.
Most helpful comment
I believe it is very important that features like those in EditorServicesCommandSuite be addable as extensions. Some of that functionality is incredibly important to powershell development, and the vast, vast majority of users are probably completely unaware of its existence. Heck, everyone I know that uses it found out about it from twitter, or by wishing features existed and googling it and finding https://sqldbawithabeard.com/2018/03/11/easily-splatting-powershell-with-vs-code/
Ease of discovery, ease of use, reliability are all lacking here, and having better extension support (and better keymapping support, ideally) should improve discovery and ease of use. The number of users using EditorServicesCommandSuite is probably abysmally small compared to the number of users that would benefit from it.