diff --git a/build/update_patches.sh b/build/update_patches.sh index 8af75c0..d3761be 100755 --- a/build/update_patches.sh +++ b/build/update_patches.sh @@ -1,5 +1,15 @@ #!/bin/bash +export VSCODE_QUALITY="stable" + +while getopts ":ilp" opt; do + case "$opt" in + i) + export VSCODE_QUALITY="insider" + ;; + esac +done + cd vscode || { echo "'vscode' dir not found"; exit 1; } git add . @@ -20,3 +30,21 @@ for FILE in ../patches/*.patch; do git reset -q --hard HEAD fi done + +if [[ "${VSCODE_QUALITY}" == "insider" ]]; then + for FILE in ../patches/insider/*.patch; do + if [ -f "${FILE}" ]; then + echo applying patch: "${FILE}" + git apply --ignore-whitespace "${FILE}" + if [ $? -ne 0 ]; then + echo failed to apply patch "${FILE}" + git apply --reject "${FILE}" + read -p "Press any key when the conflict have been resolved..." -n1 -s + git add . + git diff --staged -U1 > "${FILE}" + fi + git add . + git reset -q --hard HEAD + fi + done +fi diff --git a/insider.json b/insider.json index b62497f..353f815 100644 --- a/insider.json +++ b/insider.json @@ -1,4 +1,4 @@ { "tag": "1.74.0", - "commit": "fef85ea792f6627c83024d1df726ca729d8c9cb3" + "commit": "58e7c7b8865e3c3ea77055461ffb5d656a7a46af" } diff --git a/patches/build-version.patch b/patches/build-version.patch index ebce6e3..8a49da9 100644 --- a/patches/build-version.patch +++ b/patches/build-version.patch @@ -1,14 +1,5 @@ -diff --git a/.vscode/settings.json b/.vscode/settings.json -index 3abb868..309c37f 100644 ---- a/.vscode/settings.json -+++ b/.vscode/settings.json -@@ -90,3 +90,3 @@ - "editor.defaultFormatter": "vscode.typescript-language-features", -- "editor.formatOnSave": true -+ // "editor.formatOnSave": true - }, diff --git a/build/gulpfile.reh.js b/build/gulpfile.reh.js -index 7475e04..d930611 100644 +index f3cdbff..ac7c39b 100644 --- a/build/gulpfile.reh.js +++ b/build/gulpfile.reh.js @@ -246,4 +246,5 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa @@ -24,21 +15,21 @@ index 7475e04..d930611 100644 + .pipe(json({ commit, date, version, release })); diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js -index d5b4db0..46ca809 100644 +index cdc802b..49ab315 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js -@@ -226,3 +226,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op +@@ -227,3 +227,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op - let version = packageJson.version; + let version = packageJson.version const quality = product.quality; -@@ -234,3 +234,4 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op +@@ -235,3 +235,4 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op const name = product.nameShort; - const packageJsonUpdates = { name, version }; + const release = packageJson.release; + const packageJsonUpdates = { name, version, release }; -@@ -245,3 +246,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op +@@ -246,3 +247,3 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op const date = new Date().toISOString(); - const productJsonUpdate = { commit, date, checksums, version }; + const productJsonUpdate = { commit, date, checksums, version, release }; @@ -89,7 +80,7 @@ index 61659d2..5cafa06 100644 +Release: el7 Summary: Code editing. Redefined. diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts -index 149c3b9..6d8dd99 100644 +index 7ec238b..9295018 100644 --- a/src/vs/base/common/product.ts +++ b/src/vs/base/common/product.ts @@ -34,2 +34,3 @@ export interface IProductConfiguration { @@ -106,13 +97,13 @@ index 561966b..30814a0 100644 + output.push(`Version: ${this.productService.nameShort} ${this.productService.version} ${this.productService.release || 'Release unknown'} (${this.productService.commit || 'Commit unknown'}, ${this.productService.date || 'Date unknown'})`); output.push(`OS Version: ${osLib.type()} ${osLib.arch()} ${osLib.release()}`); diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts -index 3f50bef..465ca43 100644 +index ef798fa..cfa7866 100644 --- a/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts -@@ -49,6 +49,7 @@ else if (typeof require?.__$__nodeRequire === 'function') { +@@ -43,6 +43,7 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) { if (!product.version) { -- const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string }; -+ const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string, release: string }; +- const pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string }; ++ const pkg = globalThis._VSCODE_PACKAGE_JSON as { version: string, release: string }; Object.assign(product, { - version: pkg.version diff --git a/patches/custom-gallery.patch b/patches/custom-gallery.patch index 93abe1c..5b2151a 100644 --- a/patches/custom-gallery.patch +++ b/patches/custom-gallery.patch @@ -1,19 +1,18 @@ diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts -index 3f50bef..2b4e8c2 100644 +index ef798fa..35b848b 100644 --- a/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts -@@ -5,4 +5,4 @@ +@@ -5,3 +5,4 @@ --import { FileAccess } from 'vs/base/common/network'; -import { globals } from 'vs/base/common/platform'; +import { AppResourcePath, FileAccess } from 'vs/base/common/network'; +import { globals, isWindows } from 'vs/base/common/platform'; import { env } from 'vs/base/common/process'; -@@ -11,2 +11,3 @@ import { dirname, joinPath } from 'vs/base/common/resources'; +@@ -9,2 +10,3 @@ import { IProductConfiguration } from 'vs/base/common/product'; import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes'; +import { getUserDataPath } from 'vs/platform/environment/node/userDataPath'; -@@ -35,2 +36,41 @@ else if (typeof require?.__$__nodeRequire === 'function') { +@@ -29,2 +31,41 @@ else if (globalThis._VSCODE_PRODUCT_JSON && globalThis._VSCODE_PACKAGE_JSON) { + // Set user-defined extension gallery + const { serviceUrl, searchUrl, itemUrl, controlUrl, recommendationsUrl } = product.extensionsGallery || {} diff --git a/patches/insider/disable-sandbox.patch b/patches/insider/disable-sandbox.patch index 98964ef..c9fb6b2 100644 --- a/patches/insider/disable-sandbox.patch +++ b/patches/insider/disable-sandbox.patch @@ -1,21 +1,9 @@ diff --git a/src/vs/platform/windows/electron-main/windowImpl.ts b/src/vs/platform/windows/electron-main/windowImpl.ts -index c9501cb..a6958ff 100644 +index 3b8a644..71ea0ad 100644 --- a/src/vs/platform/windows/electron-main/windowImpl.ts +++ b/src/vs/platform/windows/electron-main/windowImpl.ts -@@ -42,7 +42,6 @@ import { Color } from 'vs/base/common/color'; - import { IPolicyService } from 'vs/platform/policy/common/policy'; - import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile'; - import { IStateMainService } from 'vs/platform/state/electron-main/state'; --import product from 'vs/platform/product/common/product'; - import { IUserDataProfilesMainService } from 'vs/platform/userDataProfile/electron-main/userDataProfile'; - - export interface IWindowCreationOptions { -@@ -203,7 +202,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { - if (typeof windowSettings?.experimental?.useSandbox === 'boolean') { - useSandbox = windowSettings.experimental.useSandbox; - } else { -- useSandbox = typeof product.quality === 'string' && product.quality !== 'stable'; -+ useSandbox = false; +@@ -213,4 +213,2 @@ export class CodeWindow extends Disposable implements ICodeWindow { + useSandbox = true; +- } else { +- useSandbox = typeof this.productService.quality === 'string' && this.productService.quality !== 'stable'; } - - const options: BrowserWindowConstructorOptions & { experimentalDarkMode: boolean } = { diff --git a/patches/insider/system-languages.patch b/patches/insider/system-languages.patch deleted file mode 100644 index d873479..0000000 --- a/patches/insider/system-languages.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/main.js b/src/main.js -index 63f8c56..a6b7d44 100644 ---- a/src/main.js -+++ b/src/main.js -@@ -575,6 +575,10 @@ async function resolveNlsConfiguration() { - */ -- // @ts-ignore API not yet available in the official Electron -- let appLocale = ((product.quality === 'insider' || product.quality === 'exploration') && app?.getPreferredSystemLanguages()?.length) ? -+ let appLocale = app.getLocale(); -+ if (product.quality === 'insider' || product.quality === 'exploration') { - // @ts-ignore API not yet available in the official Electron -- app.getPreferredSystemLanguages()[0] : app.getLocale(); -+ if (app.getPreferredSystemLanguages && app?.getPreferredSystemLanguages()?.length) { -+ // @ts-ignore API not yet available in the official Electron -+ appLocale = app.getPreferredSystemLanguages()[0]; -+ } -+ } - if (!appLocale) { diff --git a/product.json b/product.json index 31c60c1..8fd8ea7 100644 --- a/product.json +++ b/product.json @@ -223,6 +223,9 @@ ], "ms-vscode.cpptools": [ "terminalDataWriteEvent" + ], + "redhat.java": [ + "documentPaste" ] }, "extensionKind": {