Skip to content
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

custom-editor: update opener to respect option #10158

Merged
merged 1 commit into from
Sep 28, 2021

Conversation

vince-fugnitto
Copy link
Member

What it does

The pull-request updates the custom-editor to properly respect the option priority which is used to control the opener behavior.
The option priority is used by custom-editors to declare that they do not want to open with the custom-editor by default but instead with the regular opener (editor). Previously, despite option being set, the custom-editor would always be opened as it incorrectly had a higher priority than other openers.

How to test

  • include the following test plugin to your application vscode-custom-editor
  • start the application and use exampleFiles as a workspace
  • confirm that pawDraw opens with a custom-editor
  • confirm that cscratch opens with the regular editor
  • confirm that cscratch can use open with... to open with the custom-editor

Review checklist

Reminder for reviewers

Signed-off-by: vince-fugnitto [email protected]

The commit updates the `custom-editor` to respect the `option` priority
which is used to control the opener behavior. Plugins may set their
priority to `option` which will not open the custom-editor by default,
and instead default to the regular opener (editor). The custom-editor
should still be a valid opener, when they perform `opens with...`.

Signed-off-by: vince-fugnitto <[email protected]>
@vince-fugnitto vince-fugnitto added the custom-editor issues related to custom-editor functionality label Sep 23, 2021
@vince-fugnitto vince-fugnitto self-assigned this Sep 23, 2021
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I can confirm that the issue exists on master and is addressed by these changes nicely.

FYI, the pawDraw webview doesn't seem to work correctly as I get an error:

TypeError: vscode.workspace.fs.isWritableFileSystem is not a function

But that's unrelated to the changes.

@vince-fugnitto
Copy link
Member Author

TypeError: vscode.workspace.fs.isWritableFileSystem is not a function

@msujew 👍 I think we should write an issue to track it if not already done, I do see that #9863 mentions it is not implemented yet.

@vince-fugnitto vince-fugnitto merged commit 530469e into master Sep 28, 2021
@vince-fugnitto vince-fugnitto deleted the vf/custom-editor-opener branch September 28, 2021 15:06
@github-actions github-actions bot added this to the 1.18.0 milestone Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
custom-editor issues related to custom-editor functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants