提交 fc54f4b1 编写于 作者: J Joao Moreno

use opener service in extension editor

fixes #11309
上级 af877ffb
...@@ -42,6 +42,7 @@ import { Keybinding } from 'vs/base/common/keyCodes'; ...@@ -42,6 +42,7 @@ import { Keybinding } from 'vs/base/common/keyCodes';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
import { IMessageService } from 'vs/platform/message/common/message'; import { IMessageService } from 'vs/platform/message/common/message';
import { IOpenerService } from 'vs/platform/opener/common/opener';
function renderBody(body: string): string { function renderBody(body: string): string {
return `<!DOCTYPE html> return `<!DOCTYPE html>
...@@ -140,7 +141,8 @@ export class ExtensionEditor extends BaseEditor { ...@@ -140,7 +141,8 @@ export class ExtensionEditor extends BaseEditor {
@IThemeService private themeService: IThemeService, @IThemeService private themeService: IThemeService,
@IWorkbenchEditorService private editorService: IWorkbenchEditorService, @IWorkbenchEditorService private editorService: IWorkbenchEditorService,
@IKeybindingService private keybindingService: IKeybindingService, @IKeybindingService private keybindingService: IKeybindingService,
@IMessageService private messageService: IMessageService @IMessageService private messageService: IMessageService,
@IOpenerService private openerService: IOpenerService
) { ) {
super(ExtensionEditor.ID, telemetryService); super(ExtensionEditor.ID, telemetryService);
this._highlight = null; this._highlight = null;
...@@ -276,9 +278,9 @@ export class ExtensionEditor extends BaseEditor { ...@@ -276,9 +278,9 @@ export class ExtensionEditor extends BaseEditor {
webview.style(this.themeService.getColorTheme()); webview.style(this.themeService.getColorTheme());
webview.contents = [body]; webview.contents = [body];
const linkListener = webview.onDidClickLink(link => shell.openExternal(link.toString(true))); webview.onDidClickLink(link => this.openerService.open(link), null, this.contentDisposables);
const themeListener = this.themeService.onDidColorThemeChange(themeId => webview.style(themeId)); this.themeService.onDidColorThemeChange(themeId => webview.style(themeId), null, this.contentDisposables);
this.contentDisposables.push(webview, linkListener, themeListener); this.contentDisposables.push(webview);
}) })
.then(null, () => { .then(null, () => {
const p = append(this.content, $('p')); const p = append(this.content, $('p'));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册