-
Notifications
You must be signed in to change notification settings - Fork 513
RFC: Remove (or move, or improve) Register-EditorCommand
, $psEditor
etc.
#3563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'll include my response from that thread for completeness:
Yeah you gotta assembly qualify the type due to ALC weirdness. Or just type it as
Yeah I use it extensively in EditorServicesCommandSuite. I've seen it in a few profiles as well, a lot of the more simple editor commands don't get published. Makes it real hard to tell exactly how wide spread the usage is (though plenty of folks use ESCS anyway). There are also folks who just use the @adamdriscoll might use it in his addon as well. |
The |
Got the tests re-enabled at least. |
Prerequisites
Summary
I have just discovered (after maintaining this extension for the better part of the year) this entire interface around registration of editor commands. It's somewhat documented, but it doesn't seem to completely work.
I found this as I was going through our package's contributed commands, specifically one of the entry points to it:
InvokeRegisteredEditorCommand
. In #2225 this command was supposed to be exposed in the command palette:vscode-powershell/package.json
Lines 331 to 334 in d6446de
But because of the
false
there it never was. Changing it totrue
does expose it, but it fails:Additionally, I attempted to follow the documented examples. While registration of commands appears to work, and some of simple examples work (such as
MyModule.MyCommandWithFunction
), complicated commands likeMyModule.MyEditCommand
which expect a working context do not currently work.Finally, as previously noted in PowerShell/PowerShellEditorServices#1444, all of the tests for this functionality were long ago disabled.
So it's hard for me to say that this functionality is supported. Clearly it's not in use enough to be receiving bug reports despite being broken.
Proposed Design
Personally, in the name of simplification, I default to removing code that is not in use, not covered in tests, and not contributing to the core extension experience. However, I'm opening this Request For Comment because it is possible others are using this (somehow). If this code is to remain around, at the bare minimum the tests need to be brought back online. I'm not saying I'm about to delete this code right now, but I am saying I don't currently see why or how it should continue to be maintained considering its current state, hence I'm seeking feedback/education/help.
Pinging @TylerLeonhardt, @daviwil, @rjmholt, @SeeminglyScience, @TobiasPSP for comments.
Thanks in advance!
The text was updated successfully, but these errors were encountered: