-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Overwrite editor options for vscode.open and vscode.diff #110398
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
I have tried the same thing right now and I can report that it doesn't work... This is what now happens
vscode.open
registered as well (need @alexdima to refresh my memory here)vscode.open
command is invoked and it fails to convert the selection/range argumentThere 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.
It seems have not coordinated well - sorry for the duplication. I have pushed some work here: https://github.com/microsoft/vscode/compare/joh/open
The idea is that
CommandConverter#toInternal
doesn't only create/feed the delegate command but that it actually converts some (API) commands to the internal variant. E.g a tree item will then be using_workbench.open
and so onThere 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.
@jrieken What can I help with?
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.
There is
src/vs/workbench/api/common/apiCommands.ts
which registers API commands on both sides - renderer and extension host. Not sure why that was done. Also, it registers commands that accept arguments which are types ofvsocde.d.ts
which means they "don't survive" the JSON serialisation/deserialisation, likevscode.Selection
.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.
I remember... We made API command registration extension host only so that we can have multiple extension host (the
global
flag) but then we hit bugs with API-commands that escaped the extension host without treatment, like in markdown and then we added some API-commands to the renderer as well. It seems that some have evolved into a state where they only partially work in the rendererThere 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.
@jrieken I think your changes in https://github.com/microsoft/vscode/compare/joh/open are cleaner, so I am fine to drop my work and only keep the special massaging of the 2 commands on the main side. To clarify, this would mean we end up having
_workbench.open
as command in the tree and notvscode.open
? I actually prefer that because now I need to depend on some internal API knowledge in the tree. I would rather depend on_workbench.open
👍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.
Yeah, it will be
_workbench.open
and it's friends. I have created #110455 which I am planning to merge despite some polish of where to revive uris and soThere 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.
Cool 👍
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.
#110455 is merged