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

Support string argument in vscode.open #12997

Merged
merged 1 commit into from
Oct 26, 2023
Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Oct 12, 2023

What it does

Closes #12996

How to test

  1. Install the CodeGPT Chat extension
  2. Open the webview and click on the "Connect to CodeGPT Plus" button
  3. Theia should open the URL provided in an external browser window

Review checklist

Reminder for reviewers

@msujew msujew added the vscode issues related to VSCode compatibility label Oct 12, 2023
execute: async (resource: URI, columnOrOptions?: ViewColumn | TextDocumentShowOptions) => {
execute: async (resource: URI | string, columnOrOptions?: ViewColumn | TextDocumentShowOptions) => {
if (typeof resource === 'string') {
resource = URI.parse(resource);
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens, if the String does not parse into a URL? In case a URI is not openable, we have logging below, does this alos work for a malformed URI passed in as a String?

Copy link
Member Author

@msujew msujew Oct 26, 2023

Choose a reason for hiding this comment

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

URI.parse never throws, the URI will just be relatively useless. So we should be good in that regard. AFAIK vscode also doesn't validate the input when parsing from a string.

@JonasHelming
Copy link
Contributor

This might be related to #12821 @AlexandraBuzila

@msujew msujew merged commit 39935ec into master Oct 26, 2023
13 checks passed
@msujew msujew deleted the msujew/vscode-open-string branch October 26, 2023 11:29
@github-actions github-actions bot added this to the 1.43.0 milestone Oct 26, 2023
@vince-fugnitto vince-fugnitto modified the milestone: 1.43.0 Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vscode issues related to VSCode compatibility
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Allow vscode.open command to accept string URI
3 participants