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

Add ability to pass argument for 'mini-browser.openUrl' command #4243

Merged
merged 1 commit into from
Feb 5, 2019

Conversation

RomanNikitenko
Copy link
Contributor

Ability to pass argument for 'mini-browser.openUrl' command will allow to open URL in the Preview Tab without asking user to enter this one.
It would be very useful for plugin side, for example.

Signed-off-by: Roman Nikitenko rnikiten@redhat.com

@akosyakov
Copy link
Member

@RomanNikitenko Is it to implement #4051?

@RomanNikitenko
Copy link
Contributor Author

RomanNikitenko commented Feb 4, 2019

@akosyakov I need it for eclipse-che/che#11458 to implement Preview URL functionality, so to replace this part code of extension

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

looks good, please have a look at comments though

@@ -170,7 +170,7 @@ export class MiniBrowserOpenHandler extends NavigatableWidgetOpenHandler<MiniBro
isVisible: widget => !!this.getSourceUri(widget)
});
commands.registerCommand(MiniBrowserCommands.OPEN_URL, {
execute: () => this.openUrl()
execute: (arg: string) => this.openUrl(arg)
Copy link
Member

Choose a reason for hiding this comment

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

arg?: string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, thank you!

@@ -243,8 +243,8 @@ export class MiniBrowserOpenHandler extends NavigatableWidgetOpenHandler<MiniBro
return uri;
}

protected async openUrl(): Promise<void> {
const url = await this.quickInputService.open({
protected async openUrl(arg: string | undefined): Promise<void> {
Copy link
Member

Choose a reason for hiding this comment

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

arg?: string should be optional, for backward compatibility

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, thank you!

@vparfonov
Copy link
Contributor

@RomanNikitenko Is it to implement #4051?

@akosyakov I don't think so, in VS Code for "previewHtml" used TextDocumentContentProviders

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants