From 3ca96d06bc77f0ed479f13cac17a28c05761edcd Mon Sep 17 00:00:00 2001 From: chriswang521 Date: Mon, 29 May 2023 14:51:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0IDEVersion=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=89=88=E6=9C=AC=E5=8F=B7=EF=BC=8C=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=89=88=E6=9C=AC=E5=8F=B7=E4=B8=BA10.0.1,=E5=9C=A8ab?= =?UTF-8?q?out=E9=A1=B5=E9=9D=A2=E5=92=8C=E7=B3=BB=E7=BB=9F=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E8=A1=8C=E6=98=BE=E7=A4=BAkylin-code=E7=89=88?= =?UTF-8?q?=E6=9C=AC,=E5=90=8C=E6=97=B6=E4=BF=AE=E6=94=B9=E6=89=93?= =?UTF-8?q?=E5=8C=85=E4=B8=AD=E7=9A=84control=E6=96=87=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=8F=B7.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/gulpfile.vscode.linux.js | 4 ++-- package.json | 1 + src/vs/base/common/product.ts | 1 + src/vs/code/node/cli.ts | 4 ++-- src/vs/platform/product/common/product.ts | 3 ++- src/vs/workbench/browser/parts/dialogs/dialogHandler.ts | 2 +- .../workbench/electron-sandbox/parts/dialogs/dialogHandler.ts | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index d5bca549..9e977e71 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -80,7 +80,7 @@ function prepareDebPackage(arch) { const that = this; gulp.src('resources/linux/debian/control.template', { base: '.' }) .pipe(replace('@@NAME@@', product.applicationName)) - .pipe(replace('@@VERSION@@', packageJson.version + '-' + linuxPackageRevision)) + .pipe(replace('@@VERSION@@', packageJson.IDEVersion + '-' + linuxPackageRevision)) .pipe(replace('@@ARCHITECTURE@@', debArch)) .pipe(replace('@@INSTALLEDSIZE@@', Math.ceil(size / 1024))) .pipe(rename('DEBIAN/control')) @@ -183,7 +183,7 @@ function prepareRpmPackage(arch) { .pipe(replace('@@NAME@@', product.applicationName)) .pipe(replace('@@NAME_LONG@@', IdeName)) .pipe(replace('@@ICON@@', product.linuxIconName)) - .pipe(replace('@@VERSION@@', packageJson.version)) + .pipe(replace('@@VERSION@@', packageJson.IDEVersion)) .pipe(replace('@@RELEASE@@', linuxPackageRevision)) .pipe(replace('@@ARCHITECTURE@@', rpmArch)) .pipe(replace('@@LICENSE@@', product.licenseName)) diff --git a/package.json b/package.json index 0c0da689..2831f6c6 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "code-oss-dev", + "IDEVersion": "10.0.1", "version": "1.68.0", "distro": "2966cd72fc1a3a5fb89bf2d85a1a66e56206961a", "author": { diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts index f8223731..ccf0401d 100644 --- a/src/vs/base/common/product.ts +++ b/src/vs/base/common/product.ts @@ -31,6 +31,7 @@ export type ExtensionVirtualWorkspaceSupport = { }; export interface IProductConfiguration { + readonly IDEVersion: string; readonly version: string; readonly date?: string; readonly quality?: string; diff --git a/src/vs/code/node/cli.ts b/src/vs/code/node/cli.ts index 49f1f4cf..ea0bb1ed 100644 --- a/src/vs/code/node/cli.ts +++ b/src/vs/code/node/cli.ts @@ -51,12 +51,12 @@ export async function main(argv: string[]): Promise { // Help if (args.help) { const executable = `${product.applicationName}${isWindows ? '.exe' : ''}`; - console.log(buildHelpMessage(product.nameLong, executable, product.version, OPTIONS)); + console.log(buildHelpMessage(product.nameLong, executable, product.IDEVersion, OPTIONS)); } // Version Info else if (args.version) { - console.log(buildVersionMessage(product.version, product.commit)); + console.log(buildVersionMessage(product.IDEVersion, product.commit)); } // Extensions Management diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts index 7e63a164..80a651e7 100644 --- a/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts @@ -32,7 +32,7 @@ else if (typeof require?.__$__nodeRequire === 'function') { const rootPath = dirname(FileAccess.asFileUri('', require)); product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath); - const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string }; + const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { IDEVersion: string; version: string }; // Running out of sources if (env['VSCODE_DEV']) { @@ -45,6 +45,7 @@ else if (typeof require?.__$__nodeRequire === 'function') { } Object.assign(product, { + IDEVersion: pkg.IDEVersion, version: pkg.version }); } diff --git a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts index ec4ff95e..041841f7 100644 --- a/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts +++ b/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts @@ -145,7 +145,7 @@ export class BrowserDialogHandler implements IDialogHandler { const detailString = (useAgo: boolean): string => { return localize('aboutDetail', "Version: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}", - this.productService.version || 'Unknown', + this.productService.IDEVersion || 'Unknown', this.productService.commit || 'Unknown', this.productService.date ? `${this.productService.date}${useAgo ? ' (' + fromNow(new Date(this.productService.date), true) + ')' : ''}` : 'Unknown', navigator.userAgent diff --git a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts index a4728e73..3dfc6e77 100644 --- a/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts +++ b/src/vs/workbench/electron-sandbox/parts/dialogs/dialogHandler.ts @@ -156,7 +156,7 @@ export class NativeDialogHandler implements IDialogHandler { } async about(): Promise { - let version = this.productService.version; + let version = this.productService.IDEVersion; if (this.productService.target) { version = `${version} (${this.productService.target} setup)`; } else if (this.productService.darwinUniversalAssetId) {