未验证 提交 d3ff1b2f 编写于 作者: R Ramya Rao 提交者: GitHub

Open release notes in product from changelog in built in extensions (#54522)

* Open release notes in product from changelog in built in extensions

* Allow only the release notes command from webview

* Localized text may invalidate markdown, skip it
上级 e90b3669
...@@ -49,6 +49,7 @@ import { assign } from 'vs/base/common/objects'; ...@@ -49,6 +49,7 @@ import { assign } from 'vs/base/common/objects';
import { INotificationService } from 'vs/platform/notification/common/notification'; import { INotificationService } from 'vs/platform/notification/common/notification';
import { CancellationToken } from 'vs/base/common/cancellation'; import { CancellationToken } from 'vs/base/common/cancellation';
import { ExtensionsTree, IExtensionData } from 'vs/workbench/parts/extensions/browser/extensionsViewer'; import { ExtensionsTree, IExtensionData } from 'vs/workbench/parts/extensions/browser/extensionsViewer';
import { ShowCurrentReleaseNotesAction } from 'vs/workbench/parts/update/electron-browser/update';
/** A context key that is set when an extension editor webview has focus. */ /** A context key that is set when an extension editor webview has focus. */
export const KEYBINDING_CONTEXT_EXTENSIONEDITOR_WEBVIEW_FOCUS = new RawContextKey<boolean>('extensionEditorWebviewFocus', undefined); export const KEYBINDING_CONTEXT_EXTENSIONEDITOR_WEBVIEW_FOCUS = new RawContextKey<boolean>('extensionEditorWebviewFocus', undefined);
...@@ -493,8 +494,11 @@ export class ExtensionEditor extends BaseEditor { ...@@ -493,8 +494,11 @@ export class ExtensionEditor extends BaseEditor {
this.activeWebview.contents = body; this.activeWebview.contents = body;
this.activeWebview.onDidClickLink(link => { this.activeWebview.onDidClickLink(link => {
if (!link) {
return;
}
// Whitelist supported schemes for links // Whitelist supported schemes for links
if (link && ['http', 'https', 'mailto'].indexOf(link.scheme) >= 0) { if (['http', 'https', 'mailto'].indexOf(link.scheme) >= 0 || (link.scheme === 'command' && link.path === ShowCurrentReleaseNotesAction.ID)) {
this.openerService.open(link); this.openerService.open(link);
} }
}, null, this.contentDisposables); }, null, this.contentDisposables);
......
...@@ -276,7 +276,7 @@ ${this.description} ...@@ -276,7 +276,7 @@ ${this.description}
if (!changelogUrl) { if (!changelogUrl) {
if (this.type === LocalExtensionType.System) { if (this.type === LocalExtensionType.System) {
return TPromise.as(nls.localize('checkReleaseNotes', 'Please check the [VS Code Release Notes](https://code.visualstudio.com/updates) for changes to the built-in extensions.')); return TPromise.as('Please check the [VS Code Release Notes](command:update.showCurrentReleaseNotes) for changes to the built-in extensions.');
} }
return TPromise.wrapError<string>(new Error('not available')); return TPromise.wrapError<string>(new Error('not available'));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册