-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix URI Aware Command Handler Argument Duplication #8592
Fix URI Aware Command Handler Argument Duplication #8592
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good changes and ideas!
My opinion about the points you brought up (clients depending on the URI clone bug, and the multi state typing bug) is that we should deprecate the old UriAwareCommandHandler
while implementing the new ones which are free of bugs.
Deprecating doesn't mean removing, so mid-term it should be fine. Until we actually remove any deprecated API for good (on that note I did a test PR for this and I still need to take care of it at some point).
Now no matter how we handle the implementation for single vs multi uri selections, I agree that a simple API for clients is preferable. I feel like what you did with a namespace here is fine.
c29ce67
to
42b7e2d
Compare
42b7e2d
to
6709bc2
Compare
f3af630
to
fc5dd5d
Compare
Signed-off-by: Colin Grant <colin.grant@ericsson.com>
fc5dd5d
to
8dca57f
Compare
@marechal-p, I've removed all calls (I think) to the |
Signed-off-by: Colin Grant colin.grant@ericsson.com
What it does
Fixes #8585 by preventing duplication of arguments passed in. Also addresses the
todo
comment by creating separate classes for mono- and multi-select cases.There are some remaining questions:
UriAwareCommandHandler
- except that it's likely to have been used quite widely.UriAwareCommandHandler
class through the methodsUriAwareCommandHandler.MultiSelect
andUriAwareCommandHandler.MonoSelect
(or better names :)), since then the typing only needs to be correct there.[URI]
in a multi-select context, but that seems like bad behavior. If the function expects URI[], then it seems like URI is a bad call, not something to be corrected. But if anyone was relying on that, they would now get an unexpected result.How to test
packages/core/src/browser/common-frontend-contribution.ts
in theregisterCommands
function, build, and run the 'Will Cause an Error' command. See that it doesn't cause an error anymore.UriAwareCommandHandler
s and see that they work (e.g. right click on a folder in the file explorer and try 'Find in Folder')Review checklist
Reminder for reviewers