diff --git a/extensions/vscode-language-pack-zh-hans/translations/main.i18n.json b/extensions/vscode-language-pack-zh-hans/translations/main.i18n.json index f56a5a80..8979d7ad 100644 --- a/extensions/vscode-language-pack-zh-hans/translations/main.i18n.json +++ b/extensions/vscode-language-pack-zh-hans/translations/main.i18n.json @@ -2777,7 +2777,9 @@ "openUserVoiceUrl": "搜索功能请求", "openVideoTutorialsUrl": "视频教程", "miOpenExtensionDependency": "打开插件依赖管理器", - "miOpenOfflineExtensionsManager": "打开离线插件管理器" + "miOpenOfflineExtensionsManager": "打开离线插件管理器", + "openHelpDocUrl":"用户帮助文档(链接)", + "miHelpDocs":"用户帮助文档(链接)" }, "vs/workbench/browser/actions/layoutActions": { "active": "活动", diff --git a/product.json b/product.json index cebc3394..21bd7dbf 100644 --- a/product.json +++ b/product.json @@ -86,5 +86,6 @@ }, "linkProtectionTrustedDomains": [ "https://open-vsx.org" - ] + ], + "helpDocUrl":"https://gitee.com/openkylin/extensions-repo/blob/master/user-guide/%E7%9B%AE%E5%BD%95.md" } diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts index ccf0401d..cbea2c6b 100644 --- a/src/vs/base/common/product.ts +++ b/src/vs/base/common/product.ts @@ -124,6 +124,8 @@ export interface IProductConfiguration { readonly privacyStatementUrl?: string; readonly showTelemetryOptOut?: boolean; + readonly helpDocUrl?: string; + readonly serverGreeting?: string[]; readonly serverLicense?: string[]; readonly serverLicensePrompt?: string; diff --git a/src/vs/workbench/browser/actions/helpActions.ts b/src/vs/workbench/browser/actions/helpActions.ts index 48047e61..0b2845bc 100644 --- a/src/vs/workbench/browser/actions/helpActions.ts +++ b/src/vs/workbench/browser/actions/helpActions.ts @@ -317,6 +317,39 @@ class OpenPrivacyStatementUrlAction extends Action2 { } } +class OpenHelpDocUrlAction extends Action2 { + + static readonly ID = 'workbench.action.openHelpDocUrl'; + static readonly AVAILABLE = !!product.helpDocUrl; + + constructor() { + super({ + id: OpenHelpDocUrlAction.ID, + title: { + value: localize('openHelpDocUrl', "User Guides(URL)"), + mnemonicTitle: localize({ key: 'miHelpDocs', comment: ['&& denotes a mnemonic'] }, "User Guides(URL)"), + original: 'User Guides(URL)' + }, + category: CATEGORIES.Help, + f1: true, + menu: { + id: MenuId.MenubarHelpMenu, + group: '2_reference', + order: 4 + } + }); + } + + run(accessor: ServicesAccessor): void { + const productService = accessor.get(IProductService); + const openerService = accessor.get(IOpenerService); + + if (productService.helpDocUrl) { + openerService.open(URI.parse(productService.helpDocUrl)); + } + } +} + // --- Actions Registration if (KeybindingsReferenceAction.AVAILABLE) { @@ -355,6 +388,9 @@ if (OpenPrivacyStatementUrlAction.AVAILABE) { registerAction2(OpenPrivacyStatementUrlAction); } +if (OpenHelpDocUrlAction.AVAILABLE) { + registerAction2(OpenHelpDocUrlAction); +} // --- Menu Registration diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts index 2b5c2b1b..825caaa4 100644 --- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts +++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts @@ -362,6 +362,12 @@ export class GettingStartedPage extends EditorPane { this.makeCategoryVisibleWhenAvailable('requiredReading', 'getExtensions'); break; } + case 'openUserGuides': { + if (this.productService.helpDocUrl) { + this.openerService.open(URI.parse(this.productService.helpDocUrl)); + } + break; + } case 'installDependency': { // this.makeCategoryVisibleWhenAvailable('Setup', 'findLanguageExtensions'); this.commandService.executeCommand('workbench.action.openWalkthrough', { category: 'requiredReading', step: 'installDependency' }, true); @@ -982,6 +988,9 @@ export class GettingStartedPage extends EditorPane { klass: 'required-container', limit: 10,//Meaningless code empty: $('.empty-required', {}, + $('p', {}, localize('tipsMsg0', "查看更多Kylin-IDE的使用,请参见"), + $('button.button-link', { 'x-dispatch': 'openUserGuides' }, localize('openUserGuides', "用户帮助文档。")) + ), $('p', {}, localize('tipsMsg1', "如何检索到KylinIDETeam开发适配的插件?Kylin-Code默认接入OpenVSX插件商店,在Kylin-Code中可以使用插件检索列表找到KylinIDETeam开发、适配、上传到openVSX中的插件;也可以在插件详情页面找到openKylin社区插件仓库的链接。"), $('button.button-link', { 'x-dispatch': 'openDetails' }, localize('openDetails', "详情.")) ),