Make CodeEditorWidget predicate injectable#8672
Merged
Conversation
This allows downstream projects to add custom editors (not text) to the predicate and support the following scenarios for those editors: - editor/title contribution - command workbench.action.closeActiveEditor - command workbench.action.closeOtherEditors - command workbench.action.closeEditorsInGroup - command workbench.action.closeEditorsInOtherGroups - command workbench.action.closeEditorsToTheLeft - command workbench.action.closeEditorsToTheRight - command workbench.action.closeAllEditors Signed-off-by: Amiram Wingarten <amiram.wingarten@sap.com>
de720df to
b07e54e
Compare
Member
Author
|
@vince-fugnitto @vzhukovskii @azatsarynnyy is it possible for one of you to review this PR today? It would be great if we can get it in this week release. |
Member
|
Sure, I'll look at it today. |
vince-fugnitto
approved these changes
Oct 28, 2020
Member
vince-fugnitto
left a comment
There was a problem hiding this comment.
The changes look good to me 👍
I verified both the code and the fact that the provided plugin works correctly for all the available heart commands for different use-cases.
| is(arg: any): arg is CodeEditorWidget { | ||
| return arg instanceof EditorWidget || arg instanceof WebviewWidget; | ||
| } | ||
| export function getResourceUri(editor: CodeEditorWidget): CodeUri | undefined { |
Member
There was a problem hiding this comment.
minor: I'm not sure we need a breaking change note for this method, but I can certainly add a note tomorrow when I prepare the changelog for the release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Amiram Wingarten amiram.wingarten@sap.com
What it does
Make CodeEditorWidget predicate injectable instead of static namespace today.
This allows downstream projects to add custom editors (not text) to the predicate and support the following scenarios for those editors:
How to test
There shouldn't be any change in current behavior. Only refactor that allow customization in downstream projects.
Review checklist
Reminder for reviewers