From 4ef6e0d0c1c980b6d88e87a37ece9dca852ef10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Thu, 31 Oct 2024 12:21:18 +0100 Subject: [PATCH 01/13] lib: update node and npm --- demo/package.json | 4 ++-- package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demo/package.json b/demo/package.json index e81ae4dd..6af5cdd4 100644 --- a/demo/package.json +++ b/demo/package.json @@ -197,7 +197,7 @@ "esbuild": "^0.24.0" }, "volta": { - "node": "18.19.0", - "npm": "10.7.0" + "node": "20.18.0", + "npm": "10.9.0" } } diff --git a/package.json b/package.json index f2240bf4..df1a5e7a 100644 --- a/package.json +++ b/package.json @@ -143,7 +143,7 @@ "@semantic-release/github": "^10.3.4" }, "volta": { - "node": "18.19.0", - "npm": "10.7.0" + "node": "20.18.0", + "npm": "10.9.0" } } From b66efc8cbc917fd4f523004c1f666f804ce905b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Thu, 31 Oct 2024 12:22:09 +0100 Subject: [PATCH 02/13] refactor: stop using experimental syntax --- demo/vite.config.ts | 6 ++++-- demo/vite.netlify.config.ts | 7 +++++-- rollup/rollup.config.ts | 5 ++++- rollup/rollup.default-extensions.ts | 4 +++- rollup/rollup.language-packs.ts | 4 +++- rollup/rollup.monaco.ts | 5 ++++- rollup/rollup.rollup-plugins.config.ts | 9 +++++++-- 7 files changed, 30 insertions(+), 10 deletions(-) diff --git a/demo/vite.config.ts b/demo/vite.config.ts index 05d6bc08..fcaac520 100644 --- a/demo/vite.config.ts +++ b/demo/vite.config.ts @@ -2,9 +2,11 @@ import { defineConfig } from 'vite' import importMetaUrlPlugin from '@codingame/esbuild-import-meta-url-plugin' import * as fs from 'fs' import path from 'path' -import pkg from './package.json' assert { type: 'json' } +const pkg = JSON.parse( + fs.readFileSync(new URL('./package.json', import.meta.url).pathname).toString() +) -const localDependencies = Object.entries(pkg.dependencies) +const localDependencies = Object.entries(pkg.dependencies as Record) .filter(([, version]) => version.startsWith('file:../')) .map(([name]) => name) export default defineConfig({ diff --git a/demo/vite.netlify.config.ts b/demo/vite.netlify.config.ts index 9044d931..2e87dd89 100644 --- a/demo/vite.netlify.config.ts +++ b/demo/vite.netlify.config.ts @@ -1,7 +1,10 @@ import { defineConfig } from 'vite' -import pkg from './package.json' assert { type: 'json' } +import * as fs from 'fs' +const pkg = JSON.parse( + fs.readFileSync(new URL('./package.json', import.meta.url).pathname).toString() +) -const localDependencies = Object.entries(pkg.dependencies) +const localDependencies = Object.entries(pkg.dependencies as Record) .filter(([, version]) => version.startsWith('file:../')) .map(([name]) => name) diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index 0391d5b1..b66bafa5 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -18,7 +18,10 @@ import * as fs from 'node:fs' import * as nodePath from 'node:path' import { fileURLToPath } from 'node:url' import metadataPlugin from './rollup-metadata-plugin' -import pkg from '../package.json' assert { type: 'json' } + +const pkg = JSON.parse( + fs.readFileSync(new URL('../package.json', import.meta.url).pathname).toString() +) const __dirname = nodePath.dirname(fileURLToPath(import.meta.url)) diff --git a/rollup/rollup.default-extensions.ts b/rollup/rollup.default-extensions.ts index 65cce116..0dfc45c0 100644 --- a/rollup/rollup.default-extensions.ts +++ b/rollup/rollup.default-extensions.ts @@ -8,7 +8,9 @@ import * as path from 'path' import { fileURLToPath } from 'url' import metadataPlugin from './rollup-metadata-plugin' import extensionDirectoryPlugin from '../dist/rollup-extension-directory-plugin/rollup-extension-directory-plugin.js' -import pkg from '../package.json' assert { type: 'json' } +const pkg = JSON.parse( + fs.readFileSync(new URL('../package.json', import.meta.url).pathname).toString() +) const __dirname = path.dirname(fileURLToPath(import.meta.url)) diff --git a/rollup/rollup.language-packs.ts b/rollup/rollup.language-packs.ts index 6ac20628..62448667 100644 --- a/rollup/rollup.language-packs.ts +++ b/rollup/rollup.language-packs.ts @@ -7,7 +7,9 @@ import * as fs from 'fs' import * as path from 'path' import { fileURLToPath } from 'url' import * as fsPromise from 'fs/promises' -import pkg from '../package.json' assert { type: 'json' } +const pkg = JSON.parse( + fs.readFileSync(new URL('../package.json', import.meta.url).pathname).toString() +) const __dirname = path.dirname(fileURLToPath(import.meta.url)) diff --git a/rollup/rollup.monaco.ts b/rollup/rollup.monaco.ts index d466df5f..cbfd2d10 100644 --- a/rollup/rollup.monaco.ts +++ b/rollup/rollup.monaco.ts @@ -4,8 +4,11 @@ import { PackageJson } from 'type-fest' import replace from '@rollup/plugin-replace' import glob from 'fast-glob' import * as path from 'path' +import * as fs from 'fs' import { fileURLToPath } from 'url' -import pkg from '../package.json' assert { type: 'json' } +const pkg = JSON.parse( + fs.readFileSync(new URL('../package.json', import.meta.url).pathname).toString() +) const __dirname = path.dirname(fileURLToPath(import.meta.url)) diff --git a/rollup/rollup.rollup-plugins.config.ts b/rollup/rollup.rollup-plugins.config.ts index 5b7d6e44..95382d79 100644 --- a/rollup/rollup.rollup-plugins.config.ts +++ b/rollup/rollup.rollup-plugins.config.ts @@ -6,8 +6,11 @@ import json from '@rollup/plugin-json' import { PackageJson } from 'type-fest' import * as path from 'path' import { fileURLToPath } from 'url' +import * as fs from 'fs' import metadataPlugin from './rollup-metadata-plugin' -import pkg from '../package.json' assert { type: 'json' } +const pkg = JSON.parse( + fs.readFileSync(new URL('../package.json', import.meta.url).pathname).toString() +) const __dirname = path.dirname(fileURLToPath(import.meta.url)) const EXTENSIONS = ['', '.ts', '.js'] @@ -73,7 +76,9 @@ const config: rollup.RollupOptions[] = [ types: `${path.basename(output)}.d.ts`, dependencies: { ...Object.fromEntries( - Object.entries(pkg.dependencies).filter(([key]) => directDependencies.has(key)) + Object.entries(pkg.dependencies as Record).filter(([key]) => + directDependencies.has(key) + ) ) } } From c9ddca98587a8482f99f26ec225c45a3c0ae4ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Thu, 31 Oct 2024 12:22:26 +0100 Subject: [PATCH 03/13] lib!: update vscode and its dependencies --- package-lock.json | 54 +- package.json | 30 +- .../0002-fix-fix-editor-api-types.patch | 31 - ...e-amd-build-to-speed-up-editor-build.patch | 33 - vscode-paches/0004-feat-output-es2022.patch | 36 - ...markdown-do-not-encode-i10l-location.patch | 64 - ...fix-typescript-handle-trailing-slash.patch | 22 - ...fix-typescript-missing-default-value.patch | 22 - ...8-fix-typescript-handle-missing-case.patch | 24 - ...-feat-add-static-asset-url-mechanism.patch | 414 ---- ...url-search-parameter-breaking-import.patch | 22 - ...ply-style-only-on-standalone-editors.patch | 257 --- .../0012-fix-use-existing-method.patch | 22 - vscode-paches/0013-refactor-split-code.patch | 56 - ...ode-already-done-in-EditorFeaturesIn.patch | 40 - ...imports-by-regular-esm-dynamic-impor.patch | 363 --- ...-classes-and-make-some-methods-acces.patch | 516 ----- ...improve-extension-contribution-types.patch | 1672 -------------- .../0018-fix-fix-dependency-injection.patch | 25 - ...y-run-some-code-if-inside-the-worker.patch | 100 - ...ide-log-services-even-in-main-thread.patch | 65 - ...-feat-expose-extHostExtensionService.patch | 24 - .../0023-feat-expose-api-factory.patch | 41 - ...ome-modules-to-be-able-to-import-the.patch | 1951 ----------------- .../0025-fix-replace-map-by-forEach.patch | 36 - ...t-only-apply-style-on-specific-class.patch | 396 ---- ...FileAccess.asBrowserUri-at-the-root-.patch | 95 - ...anup-remove-some-checks-and-warnings.patch | 114 - .../0029-refactor-split-class-in-2.patch | 136 -- ...-supported-as-soon-as-there-is-a-reg.patch | 126 -- ...x-use-asBrowserUri-to-get-iframe-src.patch | 23 - ...dd-some-parameter-to-webview-iframes.patch | 32 - ...etect-fullscreen-if-it-s-not-a-guess.patch | 34 - .../0034-fix-only-use-open-model.patch | 112 - ...require-by-FileAccess.toModuleConten.patch | 30 - ...-a-local-folder-even-when-there-is-a.patch | 35 - ...-to-switch-storage-service-workspace.patch | 69 - ...move-code-that-we-will-run-ourselves.patch | 68 - ...se-import-function-able-to-replace-i.patch | 23 - ...o-detect-if-localization-were-alread.patch | 34 - ...on-from-service-file-to-contribution.patch | 160 -- ...efactor-split-workbench-contribution.patch | 271 --- ...or-split-service-and-extension-point.patch | 371 ---- vscode-paches/0044-fix-weird-syntax.patch | 28 - ...t-stuff-from-web-workbench-or-the-ty.patch | 104 - ...x-that-language-service-refactor-doe.patch | 26 - ...-tool-to-extract-service-identifiers.patch | 473 ---- vscode-paches/0048-fix-fix-editor-css.patch | 41 - ...ode-to-be-able-to-import-only-requir.patch | 573 ----- ...escript-as-the-last-version-breaks-t.patch | 63 - ...-fix-just-use-regular-dynamic-import.patch | 34 - .../0052-fix-fix-treeshaking-script.patch | 34 - ...r-types-build-until-it-s-fixed-by-MS.patch | 55 - ...w-data-urls-in-extension-host-worker.patch | 22 - ...tract-constants-into-separate-module.patch | 148 -- .../0058-fix-fix-missing-worker-factory.patch | 67 - 56 files changed, 44 insertions(+), 9673 deletions(-) delete mode 100644 vscode-paches/0002-fix-fix-editor-api-types.patch delete mode 100644 vscode-paches/0003-cleanup-remove-amd-build-to-speed-up-editor-build.patch delete mode 100644 vscode-paches/0004-feat-output-es2022.patch delete mode 100644 vscode-paches/0005-fix-markdown-do-not-encode-i10l-location.patch delete mode 100644 vscode-paches/0006-fix-typescript-handle-trailing-slash.patch delete mode 100644 vscode-paches/0007-fix-typescript-missing-default-value.patch delete mode 100644 vscode-paches/0008-fix-typescript-handle-missing-case.patch delete mode 100644 vscode-paches/0009-feat-add-static-asset-url-mechanism.patch delete mode 100644 vscode-paches/0010-fix-remove-ttf-url-search-parameter-breaking-import.patch delete mode 100644 vscode-paches/0011-fix-apply-style-only-on-standalone-editors.patch delete mode 100644 vscode-paches/0012-fix-use-existing-method.patch delete mode 100644 vscode-paches/0013-refactor-split-code.patch delete mode 100644 vscode-paches/0014-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch delete mode 100644 vscode-paches/0015-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch delete mode 100644 vscode-paches/0016-feat-export-some-classes-and-make-some-methods-acces.patch delete mode 100644 vscode-paches/0017-fix-improve-extension-contribution-types.patch delete mode 100644 vscode-paches/0018-fix-fix-dependency-injection.patch delete mode 100644 vscode-paches/0019-fix-only-run-some-code-if-inside-the-worker.patch delete mode 100644 vscode-paches/0020-fix-override-log-services-even-in-main-thread.patch delete mode 100644 vscode-paches/0021-feat-expose-extHostExtensionService.patch delete mode 100644 vscode-paches/0023-feat-expose-api-factory.patch delete mode 100644 vscode-paches/0024-refactor-split-some-modules-to-be-able-to-import-the.patch delete mode 100644 vscode-paches/0025-fix-replace-map-by-forEach.patch delete mode 100644 vscode-paches/0026-feat-only-apply-style-on-specific-class.patch delete mode 100644 vscode-paches/0027-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch delete mode 100644 vscode-paches/0028-cleanup-remove-some-checks-and-warnings.patch delete mode 100644 vscode-paches/0029-refactor-split-class-in-2.patch delete mode 100644 vscode-paches/0030-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch delete mode 100644 vscode-paches/0031-fix-use-asBrowserUri-to-get-iframe-src.patch delete mode 100644 vscode-paches/0032-feat-add-some-parameter-to-webview-iframes.patch delete mode 100644 vscode-paches/0033-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch delete mode 100644 vscode-paches/0034-fix-only-use-open-model.patch delete mode 100644 vscode-paches/0035-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch delete mode 100644 vscode-paches/0036-fix-allow-adding-a-local-folder-even-when-there-is-a.patch delete mode 100644 vscode-paches/0037-feat-allow-to-switch-storage-service-workspace.patch delete mode 100644 vscode-paches/0038-cleanup-remove-code-that-we-will-run-ourselves.patch delete mode 100644 vscode-paches/0039-fix-typescript-use-import-function-able-to-replace-i.patch delete mode 100644 vscode-paches/0040-feat-add-a-way-to-detect-if-localization-were-alread.patch delete mode 100644 vscode-paches/0041-fix-move-action-from-service-file-to-contribution.patch delete mode 100644 vscode-paches/0042-refactor-split-workbench-contribution.patch delete mode 100644 vscode-paches/0043-refactor-split-service-and-extension-point.patch delete mode 100644 vscode-paches/0044-fix-weird-syntax.patch delete mode 100644 vscode-paches/0045-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch delete mode 100644 vscode-paches/0046-fix-change-syntax-that-language-service-refactor-doe.patch delete mode 100644 vscode-paches/0047-feat-add-build-tool-to-extract-service-identifiers.patch delete mode 100644 vscode-paches/0048-fix-fix-editor-css.patch delete mode 100644 vscode-paches/0049-refactor-split-code-to-be-able-to-import-only-requir.patch delete mode 100644 vscode-paches/0050-fix-rollback-typescript-as-the-last-version-breaks-t.patch delete mode 100644 vscode-paches/0051-fix-just-use-regular-dynamic-import.patch delete mode 100644 vscode-paches/0052-fix-fix-treeshaking-script.patch delete mode 100644 vscode-paches/0054-fix-make-editor-types-build-until-it-s-fixed-by-MS.patch delete mode 100644 vscode-paches/0055-fix-allow-data-urls-in-extension-host-worker.patch delete mode 100644 vscode-paches/0057-fix-extract-constants-into-separate-module.patch delete mode 100644 vscode-paches/0058-fix-fix-missing-worker-factory.patch diff --git a/package-lock.json b/package-lock.json index 172e8db2..77b9a955 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,23 +21,23 @@ "@vscode/vscode-languagedetection": "1.0.21", "@vscode/windows-process-tree": "^0.6.0", "@vscode/windows-registry": "^1.1.0", - "@xterm/addon-clipboard": "^0.2.0-beta.47", - "@xterm/addon-image": "^0.9.0-beta.64", - "@xterm/addon-search": "^0.16.0-beta.64", - "@xterm/addon-serialize": "^0.14.0-beta.64", - "@xterm/addon-unicode11": "^0.9.0-beta.64", - "@xterm/addon-webgl": "^0.19.0-beta.64", - "@xterm/headless": "^5.6.0-beta.64", - "@xterm/xterm": "^5.6.0-beta.64", - "cookie": "^0.4.0", + "@xterm/addon-clipboard": "^0.2.0-beta.48", + "@xterm/addon-image": "^0.9.0-beta.65", + "@xterm/addon-search": "^0.16.0-beta.65", + "@xterm/addon-serialize": "^0.14.0-beta.65", + "@xterm/addon-unicode11": "^0.9.0-beta.65", + "@xterm/addon-webgl": "^0.19.0-beta.65", + "@xterm/headless": "^5.6.0-beta.65", + "@xterm/xterm": "^5.6.0-beta.65", + "cookie": "^0.7.2", "css-url-parser": "^1.1.4", - "jschardet": "3.1.3", + "jschardet": "3.1.4", "kerberos": "2.1.1", "keytar": "^7.9.0", "marked": "~14.0.0", "memfs": "^4.12.0", "mime-types": "^2.1.35", - "node-pty": "1.1.0-beta21", + "node-pty": "^1.1.0-beta22", "vscode-oniguruma": "1.7.0", "vscode-regexpp": "^3.1.0", "vscode-textmate": "9.1.0", @@ -64,7 +64,7 @@ "@types/mime-types": "^2.1.4", "@types/node": "18.19.8", "@types/semver": "^7.5.8", - "@types/vscode": "~1.94.0", + "@types/vscode": "~1.95.0", "@types/vscode-semver": "npm:@types/semver@=5.5.0", "@types/yargs": "^17.0.33", "@types/yauzl": "^2.10.3", @@ -3565,10 +3565,11 @@ "dev": true }, "node_modules/@types/vscode": { - "version": "1.94.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.94.0.tgz", - "integrity": "sha512-UyQOIUT0pb14XSqJskYnRwD2aG0QrPVefIfrW1djR+/J4KeFQ0i1+hjZoaAmeNf3Z2jleK+R2hv+EboG/m8ruw==", - "dev": true + "version": "1.95.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.95.0.tgz", + "integrity": "sha512-0LBD8TEiNbet3NvWsmn59zLzOFu/txSlGxnv5yAFHCrhG9WvAnR3IvfHzMOs2aeWqgvNjq9pO99IUw8d3n+unw==", + "dev": true, + "license": "MIT" }, "node_modules/@types/vscode-semver": { "name": "@types/semver", @@ -5153,9 +5154,10 @@ "dev": true }, "node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", "engines": { "node": ">= 0.6" } @@ -8080,9 +8082,10 @@ "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==" }, "node_modules/jschardet": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz", - "integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.4.tgz", + "integrity": "sha512-/kmVISmrwVwtyYU40iQUOp3SUPk2dhNCMsZBQX0R1/jZ8maaXJ/oZIzUOiyOqcgtLnETFKYChbJ5iDC/eWmFHg==", + "license": "LGPL-2.1+", "engines": { "node": ">=0.1.90" } @@ -8765,10 +8768,11 @@ } }, "node_modules/node-pty": { - "version": "1.1.0-beta21", - "resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.1.0-beta21.tgz", - "integrity": "sha512-FYpnY9g8qMQLTpqyeY9NVli6YfCWwvG6v6gmaDBbPjlc1VMp/+Zivq0SStDrRr1aciGnFCZzpL0BzdMnmbDnAw==", + "version": "1.1.0-beta9", + "resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.1.0-beta9.tgz", + "integrity": "sha512-/Ue38pvXJdgRZ3+me1FgfglLd301GhJN0NStiotdt61tm43N5htUyR/IXOUzOKuNaFmCwIhy6nwb77Ky41LMbw==", "hasInstallScript": true, + "license": "MIT", "dependencies": { "node-addon-api": "^7.1.0" } diff --git a/package.json b/package.json index df1a5e7a..3b034d8f 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,9 @@ }, "config": { "vscode": { - "version": "1.94.2", - "ref": "1.94.2", - "commit": "384ff7382de624fb94dbaf6da11977bba1ecd427" + "version": "1.95.1", + "ref": "1.95.1", + "commit": "65edc4939843c90c34d61f4ce11704f09d3e5cb6" }, "monaco": { "ref": "v0.52.0", @@ -60,7 +60,7 @@ "@types/mime-types": "^2.1.4", "@types/node": "18.19.8", "@types/semver": "^7.5.8", - "@types/vscode": "~1.94.0", + "@types/vscode": "~1.95.0", "@types/vscode-semver": "npm:@types/semver@=5.5.0", "@types/yargs": "^17.0.33", "@types/yauzl": "^2.10.3", @@ -111,23 +111,23 @@ "@vscode/vscode-languagedetection": "1.0.21", "@vscode/windows-process-tree": "^0.6.0", "@vscode/windows-registry": "^1.1.0", - "@xterm/addon-clipboard": "^0.2.0-beta.47", - "@xterm/addon-image": "^0.9.0-beta.64", - "@xterm/addon-search": "^0.16.0-beta.64", - "@xterm/addon-serialize": "^0.14.0-beta.64", - "@xterm/addon-unicode11": "^0.9.0-beta.64", - "@xterm/addon-webgl": "^0.19.0-beta.64", - "@xterm/headless": "^5.6.0-beta.64", - "@xterm/xterm": "^5.6.0-beta.64", - "cookie": "^0.4.0", + "@xterm/addon-clipboard": "^0.2.0-beta.48", + "@xterm/addon-image": "^0.9.0-beta.65", + "@xterm/addon-search": "^0.16.0-beta.65", + "@xterm/addon-serialize": "^0.14.0-beta.65", + "@xterm/addon-unicode11": "^0.9.0-beta.65", + "@xterm/addon-webgl": "^0.19.0-beta.65", + "@xterm/headless": "^5.6.0-beta.65", + "@xterm/xterm": "^5.6.0-beta.65", + "cookie": "^0.7.2", "css-url-parser": "^1.1.4", - "jschardet": "3.1.3", + "jschardet": "3.1.4", "kerberos": "2.1.1", "keytar": "^7.9.0", "marked": "~14.0.0", "memfs": "^4.12.0", "mime-types": "^2.1.35", - "node-pty": "1.1.0-beta21", + "node-pty": "^1.1.0-beta22", "vscode-oniguruma": "1.7.0", "vscode-regexpp": "^3.1.0", "vscode-textmate": "9.1.0", diff --git a/vscode-paches/0002-fix-fix-editor-api-types.patch b/vscode-paches/0002-fix-fix-editor-api-types.patch deleted file mode 100644 index 01f54aec..00000000 --- a/vscode-paches/0002-fix-fix-editor-api-types.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 16:41:55 +0100 -Subject: [PATCH] fix: fix editor api types - ---- - build/gulpfile.editor.js | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js -index 0d55982a8aa..debdf037393 100644 ---- a/build/gulpfile.editor.js -+++ b/build/gulpfile.editor.js -@@ -239,7 +239,16 @@ function toExternalDTS(contents) { - } - - if (line.indexOf('declare let MonacoEnvironment') === 0) { -- lines[i] = `declare global {\n let MonacoEnvironment: Environment | undefined;\n}`; -+ lines[i] = [ -+ 'declare global {', -+ ' let MonacoEnvironment: Environment | undefined;', -+ '', -+ ' interface Window {', -+ ' MonacoEnvironment?: Environment | undefined;', -+ ' }', -+ '}', -+ '' -+ ].join('\n'); - } - - if (line.indexOf('\tMonacoEnvironment?') === 0) { diff --git a/vscode-paches/0003-cleanup-remove-amd-build-to-speed-up-editor-build.patch b/vscode-paches/0003-cleanup-remove-amd-build-to-speed-up-editor-build.patch deleted file mode 100644 index 87dc1cae..00000000 --- a/vscode-paches/0003-cleanup-remove-amd-build-to-speed-up-editor-build.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 16:44:07 +0100 -Subject: [PATCH] cleanup: remove amd build to speed up editor build - ---- - build/gulpfile.editor.js | 13 +++---------- - 1 file changed, 3 insertions(+), 10 deletions(-) - -diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js -index debdf037393..a5951d21d34 100644 ---- a/build/gulpfile.editor.js -+++ b/build/gulpfile.editor.js -@@ -375,16 +375,9 @@ gulp.task('editor-distro', - util.rimraf('out-editor-min') - ), - extractEditorSrcTask, -- task.parallel( -- task.series( -- compileEditorAMDTask, -- optimizeEditorAMDTask, -- minifyEditorAMDTask -- ), -- task.series( -- createESMSourcesAndResourcesTask, -- compileEditorESMTask, -- ) -+ task.series( -+ createESMSourcesAndResourcesTask, -+ compileEditorESMTask, - ), - finalEditorResourcesTask - ) diff --git a/vscode-paches/0004-feat-output-es2022.patch b/vscode-paches/0004-feat-output-es2022.patch deleted file mode 100644 index 25e74c66..00000000 --- a/vscode-paches/0004-feat-output-es2022.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 16:44:35 +0100 -Subject: [PATCH] feat: output es2022 - ---- - src/tsconfig.base.json | 2 +- - src/tsconfig.monaco.json | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/tsconfig.base.json b/src/tsconfig.base.json -index 9c7aacd4f11..9f6858a7801 100644 ---- a/src/tsconfig.base.json -+++ b/src/tsconfig.base.json -@@ -27,4 +27,4 @@ - ], - "allowSyntheticDefaultImports": true - } --} -\ No newline at end of file -+} -diff --git a/src/tsconfig.monaco.json b/src/tsconfig.monaco.json -index 1e138cf9085..a2a07d7b7d3 100644 ---- a/src/tsconfig.monaco.json -+++ b/src/tsconfig.monaco.json -@@ -8,8 +8,8 @@ - "wicg-file-system-access" - ], - "paths": {}, -- "module": "amd", -- "moduleResolution": "node", -+ "module": "es2022", -+ "moduleResolution": "classic", - "removeComments": false, - "preserveConstEnums": true, - "target": "ES2022", diff --git a/vscode-paches/0005-fix-markdown-do-not-encode-i10l-location.patch b/vscode-paches/0005-fix-markdown-do-not-encode-i10l-location.patch deleted file mode 100644 index 765c22bf..00000000 --- a/vscode-paches/0005-fix-markdown-do-not-encode-i10l-location.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 16:46:45 +0100 -Subject: [PATCH] fix(markdown): do not encode i10l location - ---- - .../css-language-features/client/src/browser/cssClientMain.ts | 2 +- - .../html-language-features/client/src/browser/htmlClientMain.ts | 2 +- - .../json-language-features/client/src/browser/jsonClientMain.ts | 2 +- - extensions/markdown-language-features/src/extension.browser.ts | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/extensions/css-language-features/client/src/browser/cssClientMain.ts b/extensions/css-language-features/client/src/browser/cssClientMain.ts -index 1d4153d9836..7a81009908e 100644 ---- a/extensions/css-language-features/client/src/browser/cssClientMain.ts -+++ b/extensions/css-language-features/client/src/browser/cssClientMain.ts -@@ -16,7 +16,7 @@ export async function activate(context: ExtensionContext) { - const serverMain = Uri.joinPath(context.extensionUri, 'server/dist/browser/cssServerMain.js'); - try { - const worker = new Worker(serverMain.toString()); -- worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' }); -+ worker.postMessage({ i10lLocation: l10n.uri?.toString(true) ?? '' }); - - const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => { - return new LanguageClient(id, name, worker, clientOptions); -diff --git a/extensions/html-language-features/client/src/browser/htmlClientMain.ts b/extensions/html-language-features/client/src/browser/htmlClientMain.ts -index 06997d39fb0..d3ad70ed007 100644 ---- a/extensions/html-language-features/client/src/browser/htmlClientMain.ts -+++ b/extensions/html-language-features/client/src/browser/htmlClientMain.ts -@@ -15,7 +15,7 @@ export async function activate(context: ExtensionContext) { - const serverMain = Uri.joinPath(context.extensionUri, 'server/dist/browser/htmlServerMain.js'); - try { - const worker = new Worker(serverMain.toString()); -- worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' }); -+ worker.postMessage({ i10lLocation: l10n.uri?.toString(true) ?? '' }); - - const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => { - return new LanguageClient(id, name, worker, clientOptions); -diff --git a/extensions/json-language-features/client/src/browser/jsonClientMain.ts b/extensions/json-language-features/client/src/browser/jsonClientMain.ts -index 91ed937fe6f..95820bd3cd2 100644 ---- a/extensions/json-language-features/client/src/browser/jsonClientMain.ts -+++ b/extensions/json-language-features/client/src/browser/jsonClientMain.ts -@@ -15,7 +15,7 @@ export async function activate(context: ExtensionContext) { - const serverMain = Uri.joinPath(context.extensionUri, 'server/dist/browser/jsonServerMain.js'); - try { - const worker = new Worker(serverMain.toString()); -- worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' }); -+ worker.postMessage({ i10lLocation: l10n.uri?.toString(true) ?? '' }); - - const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => { - return new LanguageClient(id, name, worker, clientOptions); -diff --git a/extensions/markdown-language-features/src/extension.browser.ts b/extensions/markdown-language-features/src/extension.browser.ts -index 2bfc63fc857..76dbe652206 100644 ---- a/extensions/markdown-language-features/src/extension.browser.ts -+++ b/extensions/markdown-language-features/src/extension.browser.ts -@@ -30,7 +30,7 @@ function startServer(context: vscode.ExtensionContext, parser: IMdParser): Promi - const serverMain = vscode.Uri.joinPath(context.extensionUri, 'dist', 'browser', 'serverWorkerMain.js'); - - const worker = new Worker(serverMain.toString()); -- worker.postMessage({ i10lLocation: vscode.l10n.uri?.toString() ?? '' }); -+ worker.postMessage({ i10lLocation: vscode.l10n.uri?.toString(true) ?? '' }); - - return startClient((id: string, name: string, clientOptions: LanguageClientOptions) => { - return new LanguageClient(id, name, clientOptions, worker); diff --git a/vscode-paches/0006-fix-typescript-handle-trailing-slash.patch b/vscode-paches/0006-fix-typescript-handle-trailing-slash.patch deleted file mode 100644 index ea02c05e..00000000 --- a/vscode-paches/0006-fix-typescript-handle-trailing-slash.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 16:47:24 +0100 -Subject: [PATCH] fix(typescript): handle trailing slash - ---- - extensions/typescript-language-features/web/src/pathMapper.ts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/extensions/typescript-language-features/web/src/pathMapper.ts b/extensions/typescript-language-features/web/src/pathMapper.ts -index e92548950fc..b24ba5155d3 100644 ---- a/extensions/typescript-language-features/web/src/pathMapper.ts -+++ b/extensions/typescript-language-features/web/src/pathMapper.ts -@@ -20,7 +20,7 @@ export class PathMapper { - return URI.from({ - scheme: this.extensionUri.scheme, - authority: this.extensionUri.authority, -- path: this.extensionUri.path + '/dist/browser/typescript/' + filepath.slice(1) -+ path: this.extensionUri.path.replace(/\/$/, '') + '/dist/browser/typescript/' + filepath.slice(1) - }); - } - diff --git a/vscode-paches/0007-fix-typescript-missing-default-value.patch b/vscode-paches/0007-fix-typescript-missing-default-value.patch deleted file mode 100644 index ad75cbe7..00000000 --- a/vscode-paches/0007-fix-typescript-missing-default-value.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 16:48:25 +0100 -Subject: [PATCH] fix(typescript): missing default value - ---- - extensions/typescript-language-features/web/src/pathMapper.ts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/extensions/typescript-language-features/web/src/pathMapper.ts b/extensions/typescript-language-features/web/src/pathMapper.ts -index b24ba5155d3..a0c2c248f96 100644 ---- a/extensions/typescript-language-features/web/src/pathMapper.ts -+++ b/extensions/typescript-language-features/web/src/pathMapper.ts -@@ -76,7 +76,7 @@ export function fromResource(extensionUri: URI, uri: URI) { - && uri.path.endsWith('.d.ts')) { - return uri.path; - } -- return `/${uri.scheme}/${uri.authority}${uri.path}`; -+ return `/${uri.scheme}/${uri.authority || 'ts-nul-authority'}${uri.path}`; - } - - export function looksLikeLibDtsPath(filepath: string) { diff --git a/vscode-paches/0008-fix-typescript-handle-missing-case.patch b/vscode-paches/0008-fix-typescript-handle-missing-case.patch deleted file mode 100644 index 593186ab..00000000 --- a/vscode-paches/0008-fix-typescript-handle-missing-case.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 16:50:57 +0100 -Subject: [PATCH] fix(typescript): handle missing case - ---- - .../web/src/typingsInstaller/typingsInstaller.ts | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/extensions/typescript-language-features/web/src/typingsInstaller/typingsInstaller.ts b/extensions/typescript-language-features/web/src/typingsInstaller/typingsInstaller.ts -index 1f7790dc783..3ce2c137779 100644 ---- a/extensions/typescript-language-features/web/src/typingsInstaller/typingsInstaller.ts -+++ b/extensions/typescript-language-features/web/src/typingsInstaller/typingsInstaller.ts -@@ -66,7 +66,9 @@ export class WebTypingsInstallerClient implements ts.server.ITypingsInstaller { - case 'action::packageInstalled': - case 'action::invalidate': - case 'action::set': -- this.projectService!.updateTypingsForProject(response); -+ // missing case leads to error -+ case 'action::watchTypingLocations': -+ this.projectService!.updateTypingsForProject(response as ts.server.PackageInstalledResponse | ts.server.SetTypings | ts.server.InvalidateCachedTypings); - break; - case 'event::beginInstallTypes': - case 'event::endInstallTypes': diff --git a/vscode-paches/0009-feat-add-static-asset-url-mechanism.patch b/vscode-paches/0009-feat-add-static-asset-url-mechanism.patch deleted file mode 100644 index db8c4d2e..00000000 --- a/vscode-paches/0009-feat-add-static-asset-url-mechanism.patch +++ /dev/null @@ -1,414 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:11:14 +0100 -Subject: [PATCH] feat: add static asset url mechanism - ---- - src/vs/base/common/network.ts | 45 ++-- - .../api/browser/mainThreadExtensionService.ts | 7 + - .../workbench/api/common/extHost.protocol.ts | 1 + - .../workbench/api/common/extensionHostMain.ts | 5 + - .../api/worker/extensionHostWorker.ts | 219 +++++++++++++----- - 5 files changed, 208 insertions(+), 69 deletions(-) - -diff --git a/src/vs/base/common/network.ts b/src/vs/base/common/network.ts -index 7f141568abf..9eeda8b4633 100644 ---- a/src/vs/base/common/network.ts -+++ b/src/vs/base/common/network.ts -@@ -8,6 +8,8 @@ import * as platform from './platform.js'; - import { equalsIgnoreCase, startsWithIgnoreCase } from './strings.js'; - import { URI } from './uri.js'; - import * as paths from './path.js'; -+import { IDisposable, toDisposable } from './lifecycle.js'; -+import { ResourceMap } from './map.js'; - - export namespace Schemas { - -@@ -248,6 +250,20 @@ export const VSCODE_AUTHORITY = 'vscode-app'; - class FileAccessImpl { - - private static readonly FALLBACK_AUTHORITY = VSCODE_AUTHORITY; -+ private staticBrowserUris = new ResourceMap(); -+ private appResourcePathUrls = new Map string)>(); -+ -+ public registerAppResourcePathUrl(moduleId: string, url: string | (() => string)): void { -+ this.appResourcePathUrls.set(moduleId, url); -+ } -+ -+ private toUrl(moduleId: string): string { -+ let url = this.appResourcePathUrls.get(moduleId); -+ if (typeof url === 'function') { -+ url = url(); -+ } -+ return new URL(url ?? moduleId, globalThis.location?.href ?? import.meta.url).toString(); -+ } - - /** - * Returns a URI to use in contexts where the browser is responsible -@@ -256,12 +272,7 @@ class FileAccessImpl { - * **Note:** use `dom.ts#asCSSUrl` whenever the URL is to be used in CSS context. - */ - asBrowserUri(resourcePath: AppResourcePath | ''): URI { -- // ESM-comment-begin -- // const uri = this.toUri(resourcePath, require); -- // ESM-comment-end -- // ESM-uncomment-begin -- const uri = this.toUri(resourcePath); -- // ESM-uncomment-end -+ const uri = this.toUri(resourcePath, { toUrl: this.toUrl.bind(this) }); - return this.uriToBrowserUri(uri); - } - -@@ -300,7 +311,7 @@ class FileAccessImpl { - }); - } - -- return uri; -+ return this.staticBrowserUris.get(uri) ?? uri; - } - - /** -@@ -308,12 +319,7 @@ class FileAccessImpl { - * is responsible for loading. - */ - asFileUri(resourcePath: AppResourcePath | ''): URI { -- // ESM-comment-begin -- // const uri = this.toUri(resourcePath, require); -- // ESM-comment-end -- // ESM-uncomment-begin -- const uri = this.toUri(resourcePath); -- // ESM-uncomment-end -+ const uri = this.toUri(resourcePath, { toUrl: this.toUrl.bind(this) }); - return this.uriToFileUri(uri); - } - -@@ -358,6 +364,19 @@ class FileAccessImpl { - - return URI.parse(moduleIdToUrl!.toUrl(uriOrModule)); - } -+ -+ registerStaticBrowserUri(uri: URI, browserUri: URI): IDisposable { -+ this.staticBrowserUris.set(uri, browserUri); -+ return toDisposable(() => { -+ if (this.staticBrowserUris.get(uri) === browserUri) { -+ this.staticBrowserUris.delete(uri); -+ } -+ }); -+ } -+ -+ getRegisteredBrowserUris(): IterableIterator { -+ return this.staticBrowserUris.keys(); -+ } - } - - export const FileAccess = new FileAccessImpl(); -diff --git a/src/vs/workbench/api/browser/mainThreadExtensionService.ts b/src/vs/workbench/api/browser/mainThreadExtensionService.ts -index faf19a0dce2..e83837db2db 100644 ---- a/src/vs/workbench/api/browser/mainThreadExtensionService.ts -+++ b/src/vs/workbench/api/browser/mainThreadExtensionService.ts -@@ -187,6 +187,13 @@ export class MainThreadExtensionService implements MainThreadExtensionServiceSha - async $asBrowserUri(uri: UriComponents): Promise { - return FileAccess.uriToBrowserUri(URI.revive(uri)); - } -+ -+ async $getAllStaticBrowserUris(): Promise<[UriComponents, UriComponents][]> { -+ return Array.from(FileAccess.getRegisteredBrowserUris(), uri => [ -+ uri, -+ FileAccess.uriToBrowserUri(uri) -+ ]); -+ } - } - - class ExtensionHostProxy implements IExtensionHostProxy { -diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts -index 4900f545fb4..15dc855752a 100644 ---- a/src/vs/workbench/api/common/extHost.protocol.ts -+++ b/src/vs/workbench/api/common/extHost.protocol.ts -@@ -1525,6 +1525,7 @@ export interface MainThreadExtensionServiceShape extends IDisposable { - $onExtensionRuntimeError(extensionId: ExtensionIdentifier, error: SerializedError): void; - $setPerformanceMarks(marks: performance.PerformanceMark[]): Promise; - $asBrowserUri(uri: UriComponents): Promise; -+ $getAllStaticBrowserUris(): Promise<[UriComponents, UriComponents][]>; - } - - export interface SCMProviderFeatures { -diff --git a/src/vs/workbench/api/common/extensionHostMain.ts b/src/vs/workbench/api/common/extensionHostMain.ts -index 6c93b88e428..065479ba269 100644 ---- a/src/vs/workbench/api/common/extensionHostMain.ts -+++ b/src/vs/workbench/api/common/extensionHostMain.ts -@@ -189,6 +189,11 @@ export class ExtensionHostMain { - return URI.revive(await mainThreadExtensionsProxy.$asBrowserUri(uri)); - } - -+ async getAllStaticBrowserUris(): Promise<[URI, URI][]> { -+ const mainThreadExtensionsProxy = this._rpcProtocol.getProxy(MainContext.MainThreadExtensionService); -+ return (await mainThreadExtensionsProxy.$getAllStaticBrowserUris()).map(([from, to]) => [URI.revive(from), URI.revive(to)]); -+ } -+ - terminate(reason: string): void { - this._extensionService.terminate(reason); - } -diff --git a/src/vs/workbench/api/worker/extensionHostWorker.ts b/src/vs/workbench/api/worker/extensionHostWorker.ts -index d9953269acb..2180e982086 100644 ---- a/src/vs/workbench/api/worker/extensionHostWorker.ts -+++ b/src/vs/workbench/api/worker/extensionHostWorker.ts -@@ -15,7 +15,6 @@ import * as performance from '../../../base/common/performance.js'; - - import '../common/extHost.common.services.js'; - import './extHost.worker.services.js'; --import { FileAccess } from '../../../base/common/network.js'; - import { URI } from '../../../base/common/uri.js'; - - //#region --- Define, capture, and override some globals -@@ -35,6 +34,7 @@ declare namespace self { - let importScripts: any; - let fetch: _Fetch; - let XMLHttpRequest: any; -+ let importExt: any; - } - - const nativeClose = self.close.bind(self); -@@ -47,7 +47,7 @@ function shouldTransformUri(uri: string): boolean { - // In principle, we could convert any URI, but we have concerns - // that parsing https URIs might end up decoding escape characters - // and result in an unintended transformation -- return /^(file|vscode-remote):/i.test(uri); -+ return /^(file|extension-file|vscode-remote):/i.test(uri); - } - - const nativeFetch = fetch.bind(self); -@@ -89,66 +89,172 @@ self.addEventListener = () => console.trace(`'addEventListener' has been blocked - (self)['webkitResolveLocalFileSystemSyncURL'] = undefined; - (self)['webkitResolveLocalFileSystemURL'] = undefined; - --if ((self).Worker) { -- -- // make sure new Worker(...) always uses blob: (to maintain current origin) -- const _Worker = (self).Worker; -- Worker = function (stringUrl: string | URL, options?: WorkerOptions) { -- if (/^file:/i.test(stringUrl.toString())) { -- stringUrl = FileAccess.uriToBrowserUri(URI.parse(stringUrl.toString())).toString(true); -- } else if (/^vscode-remote:/i.test(stringUrl.toString())) { -- // Supporting transformation of vscode-remote URIs requires an async call to the main thread, -- // but we cannot do this call from within the embedded Worker, and the only way out would be -- // to use templating instead of a function in the web api (`resourceUriProvider`) -- throw new Error(`Creating workers from remote extensions is currently not supported.`); -- } -+function patchWorker(asBrowserUri: (uri: URI) => Promise, getAllStaticBrowserUris: () => Promise<[URI, URI][]>) { -+ if ((self).Worker) { -+ -+ // make sure new Worker(...) always uses blob: (to maintain current origin) -+ const _Worker = (self).Worker; -+ Worker = function (stringUrl: string | URL, options?: WorkerOptions) { -+ if (/^vscode-remote:/i.test(stringUrl.toString())) { -+ // Supporting transformation of vscode-remote URIs requires an async call to the main thread, -+ // but we cannot do this call from within the embedded Worker, and the only way out would be -+ // to use templating instead of a function in the web api (`resourceUriProvider`) -+ throw new Error(`Creating workers from remote extensions is currently not supported.`); -+ } - -- // IMPORTANT: bootstrapFn is stringified and injected as worker blob-url. Because of that it CANNOT -- // have dependencies on other functions or variables. Only constant values are supported. Due to -- // that logic of FileAccess.asBrowserUri had to be copied, see `asWorkerBrowserUrl` (below). -- const bootstrapFnSource = (function bootstrapFn(workerUrl: string) { -- function asWorkerBrowserUrl(url: string | URL | TrustedScriptURL): any { -- if (typeof url === 'string' || url instanceof URL) { -- return String(url).replace(/^file:\/\//i, 'vscode-file://vscode-app'); -- } -- return url; -+ async function getWorkerUri(workerUri: URI): Promise { -+ const [browserUrl, staticBrowserUrls] = await Promise.all([ -+ asBrowserUri(workerUri).then(uri => uri.toString(true)), -+ getAllStaticBrowserUris().then(bindings => Object.fromEntries(bindings.map(([from, to]) => [from.toString(true), to.toString(true)]))) -+ ]); -+ -+ // IMPORTANT: bootstrapFn is stringified and injected as worker blob-url. Because of that it CANNOT -+ // have dependencies on other functions or variables. Only constant values are supported. Due to -+ // that logic of FileAccess.asBrowserUri had to be copied, see `asWorkerBrowserUrl` (below). -+ const bootstrapFnSource = (function bootstrapFn(workerUrl: string, staticBrowserUrls: Record) { -+ function asWorkerBrowserUrl(url: string | URL | TrustedScriptURL): any { -+ if (typeof url === 'string' || url instanceof URL) { -+ url = String(url).replace(/^file:\/\//i, 'vscode-file://vscode-app'); -+ return staticBrowserUrls[url] ?? url; -+ } -+ return url; -+ } -+ -+ const nativeFetch = fetch.bind(self); -+ self.fetch = function (input, init) { -+ if (input instanceof Request) { -+ // Request object - massage not supported -+ return nativeFetch(input, init); -+ } -+ return nativeFetch(asWorkerBrowserUrl(input), init); -+ }; -+ self.XMLHttpRequest = class extends XMLHttpRequest { -+ private notFound = false; -+ override open(method: string, url: string | URL, async?: boolean, username?: string | null, password?: string | null): void { -+ const transformedUrl = asWorkerBrowserUrl(url); -+ this.notFound = transformedUrl.startsWith('extension-file:'); -+ return super.open(method, transformedUrl, async ?? true, username, password); -+ } -+ override send(body?: Document | XMLHttpRequestBodyInit | null | undefined): void { -+ if (this.notFound) { -+ return; -+ } -+ super.send(body); -+ } -+ override get status() { -+ return this.notFound ? 404 : super.status; -+ } -+ }; -+ const nativeImportScripts = importScripts.bind(self); -+ self.importScripts = (...urls: string[]) => { -+ nativeImportScripts(...urls.map(asWorkerBrowserUrl)); -+ }; -+ -+ self.importExt = (url: string) => { -+ // prevent bundler from trying to transform dynamic import -+ return new Function('url', 'return import(url)')(asWorkerBrowserUrl(url)); -+ }; -+ -+ nativeImportScripts(workerUrl); -+ }).toString(); -+ -+ const js = `(${bootstrapFnSource}('${browserUrl}', ${JSON.stringify(staticBrowserUrls)}))`; -+ -+ const blob = new Blob([js], { type: 'application/javascript' }); -+ return URL.createObjectURL(blob); - } - -- const nativeFetch = fetch.bind(self); -- self.fetch = function (input, init) { -- if (input instanceof Request) { -- // Request object - massage not supported -- return nativeFetch(input, init); -+ options = options || {}; -+ options.name = `${name} -> ${options.name || path.basename(stringUrl.toString())}`; -+ -+ class ExtensionWorker implements Worker { -+ private workerPromise: Promise; -+ constructor(scriptURL: string | URL, options?: WorkerOptions) { -+ this.workerPromise = getWorkerUri(URI.parse(scriptURL instanceof URL ? scriptURL.toString() : scriptURL)).then(url => { -+ return new _Worker(url, options); -+ }); - } -- return nativeFetch(asWorkerBrowserUrl(input), init); -- }; -- self.XMLHttpRequest = class extends XMLHttpRequest { -- override open(method: string, url: string | URL, async?: boolean, username?: string | null, password?: string | null): void { -- return super.open(method, asWorkerBrowserUrl(url), async ?? true, username, password); -+ -+ private _onmessage: Worker['onmessage'] = null; -+ set onmessage(cb: Worker['onmessage']) { -+ this._onmessage = cb; -+ this.workerPromise.then(worker => { -+ worker.onmessage = cb; -+ }, console.error); - } -- }; -- const nativeImportScripts = importScripts.bind(self); -- self.importScripts = (...urls: string[]) => { -- nativeImportScripts(...urls.map(asWorkerBrowserUrl)); -- }; -- -- nativeImportScripts(workerUrl); -- }).toString(); -- -- const js = `(${bootstrapFnSource}('${stringUrl}'))`; -- options = options || {}; -- options.name = `${name} -> ${options.name || path.basename(stringUrl.toString())}`; -- const blob = new Blob([js], { type: 'application/javascript' }); -- const blobUrl = URL.createObjectURL(blob); -- return new _Worker(blobUrl, options); -- }; - --} else { -- (self).Worker = class extends NestedWorker { -- constructor(stringOrUrl: string | URL, options?: WorkerOptions) { -- super(nativePostMessage, stringOrUrl, { name: path.basename(stringOrUrl.toString()), ...options }); -- } -- }; -+ get onmessage(): Worker['onmessage'] { -+ return this._onmessage; -+ } -+ -+ private _onmessageerror: Worker['onmessageerror'] = null; -+ set onmessageerror(cb: Worker['onmessageerror']) { -+ this._onmessageerror = cb; -+ this.workerPromise.then(worker => { -+ worker.onmessageerror = cb; -+ }, console.error); -+ } -+ -+ get onmessageerror(): Worker['onmessageerror'] { -+ return this._onmessageerror; -+ } -+ -+ private _onerror: Worker['onerror'] = null; -+ set onerror(cb: Worker['onerror']) { -+ this._onerror = cb; -+ this.workerPromise.then(worker => { -+ worker.onerror = cb; -+ }, console.error); -+ } -+ -+ get onerror(): Worker['onerror'] { -+ return this._onerror; -+ } -+ -+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -+ postMessage(message: unknown, options?: any): void { -+ this.workerPromise.then(worker => { -+ worker.postMessage(message, options); -+ }, console.error); -+ } -+ -+ terminate(): void { -+ this.workerPromise.then(worker => { -+ worker.terminate(); -+ }, console.error); -+ } -+ -+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -+ addEventListener(type: any, listener: any, options?: any): void { -+ this.workerPromise.then(worker => { -+ worker.addEventListener(type, listener, options); -+ }, console.error); -+ } -+ -+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -+ removeEventListener(type: any, listener: any, options?: any): void { -+ this.workerPromise.then(worker => { -+ worker.removeEventListener(type, listener, options); -+ }, console.error); -+ } -+ -+ dispatchEvent(event: Event): boolean { -+ this.workerPromise.then(worker => { -+ worker.dispatchEvent(event); -+ }, console.error); -+ return false; -+ } -+ } -+ return new ExtensionWorker(stringUrl, options); -+ }; -+ -+ } else { -+ (self).Worker = class extends NestedWorker { -+ constructor(stringOrUrl: string | URL, options?: WorkerOptions) { -+ super(nativePostMessage, stringOrUrl, { name: path.basename(stringOrUrl.toString()), ...options }); -+ } -+ }; -+ } - } - - //#endregion --- -@@ -259,6 +365,7 @@ export function create(): { onmessage: (message: any) => void } { - ); - - patchFetching(uri => extHostMain.asBrowserUri(uri)); -+ patchWorker(uri => extHostMain.asBrowserUri(uri), () => extHostMain.getAllStaticBrowserUris()); - - onTerminate = (reason: string) => extHostMain.terminate(reason); - }); diff --git a/vscode-paches/0010-fix-remove-ttf-url-search-parameter-breaking-import.patch b/vscode-paches/0010-fix-remove-ttf-url-search-parameter-breaking-import.patch deleted file mode 100644 index cd36ae56..00000000 --- a/vscode-paches/0010-fix-remove-ttf-url-search-parameter-breaking-import.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:12:08 +0100 -Subject: [PATCH] fix: remove ttf url search parameter breaking import - ---- - src/vs/base/browser/ui/codicons/codicon/codicon.css | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/vs/base/browser/ui/codicons/codicon/codicon.css b/src/vs/base/browser/ui/codicons/codicon/codicon.css -index 02154e77b68..d7f257db934 100644 ---- a/src/vs/base/browser/ui/codicons/codicon/codicon.css -+++ b/src/vs/base/browser/ui/codicons/codicon/codicon.css -@@ -6,7 +6,7 @@ - @font-face { - font-family: "codicon"; - font-display: block; -- src: url("./codicon.ttf?5d4d76ab2ce5108968ad644d591a16a6") format("truetype"); -+ src: url("./codicon.ttf") format("truetype"); - } - - .codicon[class*='codicon-'] { diff --git a/vscode-paches/0011-fix-apply-style-only-on-standalone-editors.patch b/vscode-paches/0011-fix-apply-style-only-on-standalone-editors.patch deleted file mode 100644 index d9efeeb6..00000000 --- a/vscode-paches/0011-fix-apply-style-only-on-standalone-editors.patch +++ /dev/null @@ -1,257 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:13:49 +0100 -Subject: [PATCH] fix: apply style only on standalone editors - ---- - .../browser/config/editorConfiguration.ts | 12 ++++++-- - .../widget/codeEditor/codeEditorWidget.ts | 11 ++++++-- - .../widget/diffEditor/diffEditorWidget.ts | 8 ++++++ - .../standalone/browser/standalone-tokens.css | 28 +++++++++---------- - .../browser/standaloneCodeEditor.ts | 4 +-- - .../test/browser/config/testConfiguration.ts | 2 +- - src/vs/editor/test/browser/testCodeEditor.ts | 2 +- - .../multicursor/notebookMulticursor.ts | 2 +- - 8 files changed, 45 insertions(+), 24 deletions(-) - -diff --git a/src/vs/editor/browser/config/editorConfiguration.ts b/src/vs/editor/browser/config/editorConfiguration.ts -index d65d85cfe25..5bdaf5cb061 100644 ---- a/src/vs/editor/browser/config/editorConfiguration.ts -+++ b/src/vs/editor/browser/config/editorConfiguration.ts -@@ -45,6 +45,7 @@ export class EditorConfiguration extends Disposable implements IEditorConfigurat - - public readonly isSimpleWidget: boolean; - public readonly contextMenuId: MenuId; -+ public readonly isStandaloneEditor: boolean; - private readonly _containerObserver: ElementSizeObserver; - - private _isDominatedByLongLines: boolean = false; -@@ -71,6 +72,7 @@ export class EditorConfiguration extends Disposable implements IEditorConfigurat - constructor( - isSimpleWidget: boolean, - contextMenuId: MenuId, -+ isStandaloneEditor: boolean, - options: Readonly, - container: HTMLElement | null, - @IAccessibilityService private readonly _accessibilityService: IAccessibilityService -@@ -78,6 +80,7 @@ export class EditorConfiguration extends Disposable implements IEditorConfigurat - super(); - this.isSimpleWidget = isSimpleWidget; - this.contextMenuId = contextMenuId; -+ this.isStandaloneEditor = isStandaloneEditor; - this._containerObserver = this._register(new ElementSizeObserver(container, options.dimension)); - this._targetWindowId = getWindow(container).vscodeWindowId; - -@@ -134,7 +137,7 @@ export class EditorConfiguration extends Disposable implements IEditorConfigurat - - protected _readEnvConfiguration(): IEnvConfiguration { - return { -- extraEditorClassName: getExtraEditorClassName(), -+ extraEditorClassName: getExtraEditorClassName(this.isStandaloneEditor), - outerWidth: this._containerObserver.getWidth(), - outerHeight: this._containerObserver.getHeight(), - emptySelectionClipboard: browser.isWebKit || browser.isFirefox, -@@ -222,7 +225,7 @@ function digitCount(n: number): number { - return r ? r : 1; - } - --function getExtraEditorClassName(): string { -+function getExtraEditorClassName(isStandaloneEditor: boolean): string { - let extra = ''; - if (!browser.isSafari && !browser.isWebkitWebView) { - // Use user-select: none in all browsers except Safari and native macOS WebView -@@ -236,6 +239,9 @@ function getExtraEditorClassName(): string { - if (platform.isMacintosh) { - extra += 'mac '; - } -+ if (isStandaloneEditor) { -+ extra += 'standalone '; -+ } - return extra; - } - -@@ -277,7 +283,7 @@ export class ComputedEditorOptions implements IComputedEditorOptions { - } - } - --class EditorOptionsUtil { -+export class EditorOptionsUtil { - - public static validateOptions(options: IEditorOptions): ValidatedEditorOptions { - const result = new ValidatedEditorOptions(); -diff --git a/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts -index 59f027dd434..91703a85ce8 100644 ---- a/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts -+++ b/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts -@@ -273,6 +273,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE - - this._configuration = this._register(this._createConfiguration(codeEditorWidgetOptions.isSimpleWidget || false, - codeEditorWidgetOptions.contextMenuId ?? (codeEditorWidgetOptions.isSimpleWidget ? MenuId.SimpleEditorContext : MenuId.EditorContext), -+ codeEditorWidgetOptions.isStandaloneEditor || false, - options, accessibilityService)); - this._register(this._configuration.onDidChange((e) => { - this._onDidChangeConfiguration.fire(e); -@@ -381,8 +382,8 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE - this._modelData?.view.writeScreenReaderContent(reason); - } - -- protected _createConfiguration(isSimpleWidget: boolean, contextMenuId: MenuId, options: Readonly, accessibilityService: IAccessibilityService): EditorConfiguration { -- return new EditorConfiguration(isSimpleWidget, contextMenuId, options, this._domElement, accessibilityService); -+ protected _createConfiguration(isSimpleWidget: boolean, contextMenuId: MenuId, isStandaloneEditor: boolean, options: Readonly, accessibilityService: IAccessibilityService): EditorConfiguration { -+ return new EditorConfiguration(isSimpleWidget, contextMenuId, isStandaloneEditor, options, this._domElement, accessibilityService); - } - - public getId(): string { -@@ -1959,6 +1960,12 @@ export interface ICodeEditorWidgetOptions { - */ - isSimpleWidget?: boolean; - -+ /** -+ * Is this a standalone editor -+ * Defaults to false. -+ */ -+ isStandaloneEditor?: boolean; -+ - /** - * Contributions to instantiate. - * When provided, only the contributions included will be instantiated. -diff --git a/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts -index da2e28f1c44..41d9152f1e6 100644 ---- a/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts -+++ b/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts -@@ -51,6 +51,12 @@ import { CSSStyle, ObservableElementSizeObserver, RefCounted, applyStyle, applyV - export interface IDiffCodeEditorWidgetOptions { - originalEditor?: ICodeEditorWidgetOptions; - modifiedEditor?: ICodeEditorWidgetOptions; -+ -+ /** -+ * Is this a standalone editor -+ * Defaults to false. -+ */ -+ isStandaloneEditor?: boolean; - } - - export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor { -@@ -110,6 +116,8 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor { - - this._contextKeyService.createKey('isInDiffEditor', true); - -+ this.elements.root.classList.toggle('standalone', codeEditorWidgetOptions.isStandaloneEditor || false); -+ - this._domElement.appendChild(this.elements.root); - this._register(toDisposable(() => this.elements.root.remove())); - -diff --git a/src/vs/editor/standalone/browser/standalone-tokens.css b/src/vs/editor/standalone/browser/standalone-tokens.css -index 1fc85078f9e..c74aca00541 100644 ---- a/src/vs/editor/standalone/browser/standalone-tokens.css -+++ b/src/vs/editor/standalone/browser/standalone-tokens.css -@@ -5,7 +5,7 @@ - - - /* Default standalone editor fonts */ --.monaco-editor { -+.monaco-editor.standalone { - font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif; - --monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace; - } -@@ -14,9 +14,9 @@ - stroke-width: 1.2px; - } - --.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label, --.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label, --.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label { -+.monaco-editor.standalone.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label, -+.monaco-editor.standalone.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label, -+.monaco-editor.standalone.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label { - stroke-width: 1.2px; - } - -@@ -37,16 +37,16 @@ - clip-path: inset(50%); - } - --.monaco-editor, .monaco-diff-editor .synthetic-focus, --.monaco-editor, .monaco-diff-editor [tabindex="0"]:focus, --.monaco-editor, .monaco-diff-editor [tabindex="-1"]:focus, --.monaco-editor, .monaco-diff-editor button:focus, --.monaco-editor, .monaco-diff-editor input[type=button]:focus, --.monaco-editor, .monaco-diff-editor input[type=checkbox]:focus, --.monaco-editor, .monaco-diff-editor input[type=search]:focus, --.monaco-editor, .monaco-diff-editor input[type=text]:focus, --.monaco-editor, .monaco-diff-editor select:focus, --.monaco-editor, .monaco-diff-editor textarea:focus { -+.monaco-editor.standalone, .monaco-diff-editor.standalone .synthetic-focus, -+.monaco-editor.standalone, .monaco-diff-editor.standalone [tabindex="0"]:focus, -+.monaco-editor.standalone, .monaco-diff-editor.standalone [tabindex="-1"]:focus, -+.monaco-editor.standalone, .monaco-diff-editor.standalone button:focus, -+.monaco-editor.standalone, .monaco-diff-editor.standalone input[type=button]:focus, -+.monaco-editor.standalone, .monaco-diff-editor.standalone input[type=checkbox]:focus, -+.monaco-editor.standalone, .monaco-diff-editor.standalone input[type=search]:focus, -+.monaco-editor.standalone, .monaco-diff-editor.standalone input[type=text]:focus, -+.monaco-editor.standalone, .monaco-diff-editor.standalone select:focus, -+.monaco-editor.standalone, .monaco-diff-editor.standalone textarea:focus { - outline-width: 1px; - outline-style: solid; - outline-offset: -1px; -diff --git a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts -index 2b7abea38c1..15917f7df1b 100644 ---- a/src/vs/editor/standalone/browser/standaloneCodeEditor.ts -+++ b/src/vs/editor/standalone/browser/standaloneCodeEditor.ts -@@ -283,7 +283,7 @@ export class StandaloneCodeEditor extends CodeEditorWidget implements IStandalon - ) { - const options = { ..._options }; - options.ariaLabel = options.ariaLabel || StandaloneCodeEditorNLS.editorViewAccessibleLabel; -- super(domElement, options, {}, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService); -+ super(domElement, options, { isStandaloneEditor: true }, instantiationService, codeEditorService, commandService, contextKeyService, themeService, notificationService, accessibilityService, languageConfigurationService, languageFeaturesService); - - if (keybindingService instanceof StandaloneKeybindingService) { - this._standaloneKeybindingService = keybindingService; -@@ -521,7 +521,7 @@ export class StandaloneDiffEditor2 extends DiffEditorWidget implements IStandalo - super( - domElement, - options, -- {}, -+ { isStandaloneEditor: true }, - contextKeyService, - instantiationService, - codeEditorService, -diff --git a/src/vs/editor/test/browser/config/testConfiguration.ts b/src/vs/editor/test/browser/config/testConfiguration.ts -index 3c1862c967d..2d565b57506 100644 ---- a/src/vs/editor/test/browser/config/testConfiguration.ts -+++ b/src/vs/editor/test/browser/config/testConfiguration.ts -@@ -14,7 +14,7 @@ import { MenuId } from '../../../../platform/actions/common/actions.js'; - export class TestConfiguration extends EditorConfiguration { - - constructor(opts: Readonly) { -- super(false, MenuId.EditorContext, opts, null, new TestAccessibilityService()); -+ super(false, MenuId.EditorContext, false, opts, null, new TestAccessibilityService()); - } - - protected override _readEnvConfiguration(): IEnvConfiguration { -diff --git a/src/vs/editor/test/browser/testCodeEditor.ts b/src/vs/editor/test/browser/testCodeEditor.ts -index 72da1933953..c27b2879421 100644 ---- a/src/vs/editor/test/browser/testCodeEditor.ts -+++ b/src/vs/editor/test/browser/testCodeEditor.ts -@@ -71,7 +71,7 @@ export interface ITestCodeEditor extends IActiveCodeEditor { - export class TestCodeEditor extends CodeEditorWidget implements ICodeEditor { - - //#region testing overrides -- protected override _createConfiguration(isSimpleWidget: boolean, contextMenuId: MenuId, options: Readonly): EditorConfiguration { -+ protected override _createConfiguration(isSimpleWidget: boolean, contextMenuId: MenuId, isStandaloneEditor: boolean, options: Readonly): EditorConfiguration { - return new TestConfiguration(options); - } - protected override _createView(viewModel: ViewModel): [View, boolean] { -diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.ts b/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.ts -index 9309d784fd7..77671aca0cc 100644 ---- a/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.ts -+++ b/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.ts -@@ -688,7 +688,7 @@ export class NotebookMultiCursorController extends Disposable implements INotebo - private constructCellEditorOptions(cell: ICellViewModel): EditorConfiguration { - const cellEditorOptions = new CellEditorOptions(this.notebookEditor.getBaseCellEditorOptions(cell.language), this.notebookEditor.notebookOptions, this.configurationService); - const options = cellEditorOptions.getUpdatedValue(cell.internalMetadata, cell.uri); -- return new EditorConfiguration(false, MenuId.EditorContent, options, null, this.accessibilityService); -+ return new EditorConfiguration(false, MenuId.EditorContent, false, options, null, this.accessibilityService); - } - - /** diff --git a/vscode-paches/0012-fix-use-existing-method.patch b/vscode-paches/0012-fix-use-existing-method.patch deleted file mode 100644 index eb6c298c..00000000 --- a/vscode-paches/0012-fix-use-existing-method.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:14:41 +0100 -Subject: [PATCH] fix: use existing method - ---- - src/vs/editor/standalone/browser/standaloneServices.ts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/vs/editor/standalone/browser/standaloneServices.ts b/src/vs/editor/standalone/browser/standaloneServices.ts -index 085ca6352f2..e5c1e247082 100644 ---- a/src/vs/editor/standalone/browser/standaloneServices.ts -+++ b/src/vs/editor/standalone/browser/standaloneServices.ts -@@ -559,7 +559,7 @@ export class StandaloneKeybindingService extends AbstractKeybindingService { - // This might be a removal keybinding item in user settings => accept it - result[resultLen++] = new ResolvedKeybindingItem(undefined, item.command, item.commandArgs, when, isDefault, null, false); - } else { -- const resolvedKeybindings = USLayoutResolvedKeybinding.resolveKeybinding(keybinding, OS); -+ const resolvedKeybindings = this.resolveKeybinding(keybinding); - for (const resolvedKeybinding of resolvedKeybindings) { - result[resultLen++] = new ResolvedKeybindingItem(resolvedKeybinding, item.command, item.commandArgs, when, isDefault, null, false); - } diff --git a/vscode-paches/0013-refactor-split-code.patch b/vscode-paches/0013-refactor-split-code.patch deleted file mode 100644 index 017eb348..00000000 --- a/vscode-paches/0013-refactor-split-code.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:14:56 +0100 -Subject: [PATCH] refactor: split code - ---- - src/vs/editor/standalone/browser/standaloneServices.ts | 8 ++++++-- - .../services/keybinding/browser/keybindingService.ts | 6 +++++- - 2 files changed, 11 insertions(+), 3 deletions(-) - -diff --git a/src/vs/editor/standalone/browser/standaloneServices.ts b/src/vs/editor/standalone/browser/standaloneServices.ts -index e5c1e247082..260e404f3dd 100644 ---- a/src/vs/editor/standalone/browser/standaloneServices.ts -+++ b/src/vs/editor/standalone/browser/standaloneServices.ts -@@ -530,15 +530,19 @@ export class StandaloneKeybindingService extends AbstractKeybindingService { - }); - } - -- private updateResolver(): void { -+ protected updateResolver(): void { - this._cachedResolver = null; - this._onDidUpdateKeybindings.fire(); - } - -+ protected getUserKeybindingItems() { -+ return this._toNormalizedKeybindingItems(this._dynamicKeybindings, false); -+ } -+ - protected _getResolver(): KeybindingResolver { - if (!this._cachedResolver) { - const defaults = this._toNormalizedKeybindingItems(KeybindingsRegistry.getDefaultKeybindings(), true); -- const overrides = this._toNormalizedKeybindingItems(this._dynamicKeybindings, false); -+ const overrides = this.getUserKeybindingItems(); - this._cachedResolver = new KeybindingResolver(defaults, overrides, (str) => this._log(str)); - } - return this._cachedResolver; -diff --git a/src/vs/workbench/services/keybinding/browser/keybindingService.ts b/src/vs/workbench/services/keybinding/browser/keybindingService.ts -index 671f9552963..de6fc38cd0a 100644 ---- a/src/vs/workbench/services/keybinding/browser/keybindingService.ts -+++ b/src/vs/workbench/services/keybinding/browser/keybindingService.ts -@@ -428,10 +428,14 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService { - this._onDidUpdateKeybindings.fire(); - } - -+ protected getUserKeybindingItems() { -+ return this._resolveUserKeybindingItems(this.userKeybindings.keybindings, false); -+ } -+ - protected _getResolver(): KeybindingResolver { - if (!this._cachedResolver) { - const defaults = this._resolveKeybindingItems(KeybindingsRegistry.getDefaultKeybindings(), true); -- const overrides = this._resolveUserKeybindingItems(this.userKeybindings.keybindings, false); -+ const overrides = this.getUserKeybindingItems(); - this._cachedResolver = new KeybindingResolver(defaults, overrides, (str) => this._log(str)); - } - return this._cachedResolver; diff --git a/vscode-paches/0014-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch b/vscode-paches/0014-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch deleted file mode 100644 index 015babb5..00000000 --- a/vscode-paches/0014-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:15:40 +0100 -Subject: [PATCH] cleanup: remove code already done in - EditorFeaturesInstantiator - ---- - .../editor/standalone/browser/standaloneServices.ts | 12 ------------ - 1 file changed, 12 deletions(-) - -diff --git a/src/vs/editor/standalone/browser/standaloneServices.ts b/src/vs/editor/standalone/browser/standaloneServices.ts -index 260e404f3dd..17f50fb819e 100644 ---- a/src/vs/editor/standalone/browser/standaloneServices.ts -+++ b/src/vs/editor/standalone/browser/standaloneServices.ts -@@ -91,8 +91,6 @@ import { AccessibilitySignal, AccessibilityModality, IAccessibilitySignalService - import { ILanguageFeaturesService } from '../../common/services/languageFeatures.js'; - import { ILanguageConfigurationService } from '../../common/languages/languageConfigurationRegistry.js'; - import { LogService } from '../../../platform/log/common/logService.js'; --import { getEditorFeatures } from '../../common/editorFeatures.js'; --import { onUnexpectedError } from '../../../base/common/errors.js'; - import { ExtensionKind, IEnvironmentService, IExtensionHostDebugParams } from '../../../platform/environment/common/environment.js'; - import { mainWindow } from '../../../base/browser/window.js'; - import { ResourceMap } from '../../../base/common/map.js'; -@@ -1229,16 +1227,6 @@ export module StandaloneServices { - } - } - -- // Instantiate all editor features -- const editorFeatures = getEditorFeatures(); -- for (const feature of editorFeatures) { -- try { -- instantiationService.createInstance(feature); -- } catch (err) { -- onUnexpectedError(err); -- } -- } -- - onDidInitialize.fire(); - - return instantiationService; diff --git a/vscode-paches/0015-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch b/vscode-paches/0015-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch deleted file mode 100644 index 53cfcaec..00000000 --- a/vscode-paches/0015-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch +++ /dev/null @@ -1,363 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:22:31 +0100 -Subject: [PATCH] fix: replace amd imports by regular esm dynamic imports - ---- - .eslintrc.json | 9 +-------- - .../assignment/common/assignmentService.ts | 3 +-- - src/vs/platform/telemetry/common/1dsAppender.ts | 16 ++-------------- - .../contrib/terminal/browser/terminalInstance.ts | 3 +-- - .../terminal/browser/xterm/xtermTerminal.ts | 13 ++++++------- - .../browser/terminalStickyScrollOverlay.ts | 5 ++--- - .../textMateWorkerTokenizerController.ts | 3 +-- - .../worker/textMateTokenizationWorker.worker.ts | 5 ++--- - .../worker/textMateWorkerTokenizer.ts | 3 +-- - .../browser/textMateTokenizationFeatureImpl.ts | 6 +++--- - .../services/textfile/common/encoding.ts | 14 ++++---------- - 11 files changed, 24 insertions(+), 56 deletions(-) - -diff --git a/.eslintrc.json b/.eslintrc.json -index 6282847cafb..795a5b934e8 100644 ---- a/.eslintrc.json -+++ b/.eslintrc.json -@@ -301,14 +301,6 @@ - "jsdoc/require-returns": "warn" - } - }, -- { -- "files": [ -- "src/**/{common,browser}/**/*.ts" -- ], -- "rules": { -- "local/code-amd-node-module": "warn" -- } -- }, - { - "files": [ - "src/**/{browser,electron-sandbox}/**/*.ts" -@@ -933,6 +925,7 @@ - }, // TODO@layers - "tas-client-umd", // node module allowed even in /common/ - "vscode-textmate", // node module allowed even in /common/ -+ "vscode-oniguruma", - "@vscode/vscode-languagedetection", // node module allowed even in /common/ - "@vscode/tree-sitter-wasm", // type import - { -diff --git a/src/vs/platform/assignment/common/assignmentService.ts b/src/vs/platform/assignment/common/assignmentService.ts -index 413bd60f7ff..2e7fcb3d31c 100644 ---- a/src/vs/platform/assignment/common/assignmentService.ts -+++ b/src/vs/platform/assignment/common/assignmentService.ts -@@ -9,7 +9,6 @@ import { IConfigurationService } from '../../configuration/common/configuration. - import { IProductService } from '../../product/common/productService.js'; - import { getTelemetryLevel } from '../../telemetry/common/telemetryUtils.js'; - import { AssignmentFilterProvider, ASSIGNMENT_REFETCH_INTERVAL, ASSIGNMENT_STORAGE_KEY, IAssignmentService, TargetPopulation } from './assignment.js'; --import { importAMDNodeModule } from '../../../amdX.js'; - import { IEnvironmentService } from '../../environment/common/environment.js'; - - export abstract class BaseAssignmentService implements IAssignmentService { -@@ -88,7 +87,7 @@ export abstract class BaseAssignmentService implements IAssignmentService { - ); - - const tasConfig = this.productService.tasConfig!; -- const tasClient = new (await importAMDNodeModule('tas-client-umd', 'lib/tas-client-umd.js')).ExperimentationService({ -+ const tasClient = new (await import('tas-client-umd')).ExperimentationService({ - filterProviders: [filterProvider], - telemetry: this.telemetry, - storageKey: ASSIGNMENT_STORAGE_KEY, -diff --git a/src/vs/platform/telemetry/common/1dsAppender.ts b/src/vs/platform/telemetry/common/1dsAppender.ts -index bddf9da2530..e25b981dc45 100644 ---- a/src/vs/platform/telemetry/common/1dsAppender.ts -+++ b/src/vs/platform/telemetry/common/1dsAppender.ts -@@ -5,10 +5,8 @@ - - import type { IExtendedConfiguration, IExtendedTelemetryItem, ITelemetryItem, ITelemetryUnloadState } from '@microsoft/1ds-core-js'; - import type { IChannelConfiguration, IXHROverride, PostChannel } from '@microsoft/1ds-post-js'; --import { importAMDNodeModule } from '../../../amdX.js'; - import { onUnexpectedError } from '../../../base/common/errors.js'; - import { mixin } from '../../../base/common/objects.js'; --import { isWeb } from '../../../base/common/platform.js'; - import { ITelemetryAppender, validateTelemetryData } from './telemetryUtils.js'; - - // Interface type which is a subset of @microsoft/1ds-core-js AppInsightsCore. -@@ -23,18 +21,8 @@ const endpointUrl = 'https://mobile.events.data.microsoft.com/OneCollector/1.0'; - const endpointHealthUrl = 'https://mobile.events.data.microsoft.com/ping'; - - async function getClient(instrumentationKey: string, addInternalFlag?: boolean, xhrOverride?: IXHROverride): Promise { -- // ESM-comment-begin -- // if (isWeb) { /* fix the import warning */ } -- // const oneDs = await importAMDNodeModule('@microsoft/1ds-core-js', 'dist/ms.core.js'); -- // const postPlugin = await importAMDNodeModule('@microsoft/1ds-post-js', 'dist/ms.post.js'); -- // ESM-comment-end -- // ESM-uncomment-begin -- // eslint-disable-next-line local/code-amd-node-module -- const oneDs = isWeb ? await importAMDNodeModule('@microsoft/1ds-core-js', 'bundle/ms.core.min.js') : await import('@microsoft/1ds-core-js'); -- // eslint-disable-next-line local/code-amd-node-module -- const postPlugin = isWeb ? await importAMDNodeModule('@microsoft/1ds-post-js', 'bundle/ms.post.min.js') : await import('@microsoft/1ds-post-js'); -- // ESM-uncomment-end -- -+ const oneDs = await import('@microsoft/1ds-core-js'); -+ const postPlugin = await import('@microsoft/1ds-post-js'); - const appInsightsCore = new oneDs.AppInsightsCore(); - const collectorChannelPlugin: PostChannel = new postPlugin.PostChannel(); - // Configure the app insights core to send to collector++ and disable logging of debug info -diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts -index f90969a2c60..8242cac8810 100644 ---- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts -+++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts -@@ -82,7 +82,6 @@ import { IHistoryService } from '../../../services/history/common/history.js'; - import { isHorizontal, IWorkbenchLayoutService } from '../../../services/layout/browser/layoutService.js'; - import { IPathService } from '../../../services/path/common/pathService.js'; - import { IPreferencesService } from '../../../services/preferences/common/preferences.js'; --import { importAMDNodeModule } from '../../../../amdX.js'; - import type { IMarker, Terminal as XTermTerminal } from '@xterm/xterm'; - import { AccessibilityCommandId } from '../../accessibility/common/accessibilityCommands.js'; - import { terminalStrings } from '../common/terminalStrings.js'; -@@ -729,7 +728,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { - return xtermConstructor; - } - xtermConstructor = Promises.withAsyncBody(async (resolve) => { -- const Terminal = (await importAMDNodeModule('@xterm/xterm', 'lib/xterm.js')).Terminal; -+ const Terminal = (await import('@xterm/xterm')).Terminal; - // Localize strings - Terminal.strings.promptLabel = nls.localize('terminal.integrated.a11yPromptLabel', 'Terminal input'); - Terminal.strings.tooMuchOutput = keybinding ? nls.localize('terminal.integrated.useAccessibleBuffer', 'Use the accessible buffer {0} to manually review output', keybinding.getLabel()) : nls.localize('terminal.integrated.useAccessibleBufferNoKb', 'Use the Terminal: Focus Accessible Buffer command to manually review output'); -diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts -index c5bd84fa997..10bcb52ec64 100644 ---- a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts -+++ b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts -@@ -31,7 +31,6 @@ import { DecorationAddon } from './decorationAddon.js'; - import { ITerminalCapabilityStore, ITerminalCommand, TerminalCapability } from '../../../../../platform/terminal/common/capabilities/capabilities.js'; - import { Emitter } from '../../../../../base/common/event.js'; - import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js'; --import { importAMDNodeModule } from '../../../../../amdX.js'; - import { IContextKey, IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js'; - import { TerminalContextKeys } from '../../common/terminalContextKey.js'; - import { IClipboardService } from '../../../../../platform/clipboard/common/clipboardService.js'; -@@ -738,42 +737,42 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach - - protected async _getClipboardAddonConstructor(): Promise { - if (!ClipboardAddon) { -- ClipboardAddon = (await importAMDNodeModule('@xterm/addon-clipboard', 'lib/addon-clipboard.js')).ClipboardAddon; -+ ClipboardAddon = (await import('@xterm/addon-clipboard')).ClipboardAddon; - } - return ClipboardAddon; - } - - protected async _getImageAddonConstructor(): Promise { - if (!ImageAddon) { -- ImageAddon = (await importAMDNodeModule('@xterm/addon-image', 'lib/addon-image.js')).ImageAddon; -+ ImageAddon = (await import('@xterm/addon-image')).ImageAddon; - } - return ImageAddon; - } - - protected async _getSearchAddonConstructor(): Promise { - if (!SearchAddon) { -- SearchAddon = (await importAMDNodeModule('@xterm/addon-search', 'lib/addon-search.js')).SearchAddon; -+ SearchAddon = (await import('@xterm/addon-search')).SearchAddon; - } - return SearchAddon; - } - - protected async _getUnicode11Constructor(): Promise { - if (!Unicode11Addon) { -- Unicode11Addon = (await importAMDNodeModule('@xterm/addon-unicode11', 'lib/addon-unicode11.js')).Unicode11Addon; -+ Unicode11Addon = (await import('@xterm/addon-unicode11')).Unicode11Addon; - } - return Unicode11Addon; - } - - protected async _getWebglAddonConstructor(): Promise { - if (!WebglAddon) { -- WebglAddon = (await importAMDNodeModule('@xterm/addon-webgl', 'lib/addon-webgl.js')).WebglAddon; -+ WebglAddon = (await import('@xterm/addon-webgl')).WebglAddon; - } - return WebglAddon; - } - - protected async _getSerializeAddonConstructor(): Promise { - if (!SerializeAddon) { -- SerializeAddon = (await importAMDNodeModule('@xterm/addon-serialize', 'lib/addon-serialize.js')).SerializeAddon; -+ SerializeAddon = (await import('@xterm/addon-serialize')).SerializeAddon; - } - return SerializeAddon; - } -diff --git a/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts b/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts -index c85159b3b8b..139f18f535a 100644 ---- a/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts -+++ b/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts -@@ -6,7 +6,6 @@ - import type { SerializeAddon as SerializeAddonType } from '@xterm/addon-serialize'; - import type { WebglAddon as WebglAddonType } from '@xterm/addon-webgl'; - import type { IBufferLine, IMarker, ITerminalOptions, ITheme, Terminal as RawXtermTerminal, Terminal as XTermTerminal } from '@xterm/xterm'; --import { importAMDNodeModule } from '../../../../../amdX.js'; - import { $, addDisposableListener, addStandardDisposableListener, getWindow } from '../../../../../base/browser/dom.js'; - import { memoize, throttle } from '../../../../../base/common/decorators.js'; - import { Event } from '../../../../../base/common/event.js'; -@@ -484,12 +483,12 @@ export class TerminalStickyScrollOverlay extends Disposable { - - @memoize - private async _getSerializeAddonConstructor(): Promise { -- return (await importAMDNodeModule('@xterm/addon-serialize', 'lib/addon-serialize.js')).SerializeAddon; -+ return (await import('@xterm/addon-serialize')).SerializeAddon; - } - - @memoize - private async _getWebglAddonConstructor(): Promise { -- return (await importAMDNodeModule('@xterm/addon-webgl', 'lib/addon-webgl.js')).WebglAddon; -+ return (await import('@xterm/addon-webgl')).WebglAddon; - } - } - -diff --git a/src/vs/workbench/services/textMate/browser/backgroundTokenization/textMateWorkerTokenizerController.ts b/src/vs/workbench/services/textMate/browser/backgroundTokenization/textMateWorkerTokenizerController.ts -index fa0f874e7e8..81d64022868 100644 ---- a/src/vs/workbench/services/textMate/browser/backgroundTokenization/textMateWorkerTokenizerController.ts -+++ b/src/vs/workbench/services/textMate/browser/backgroundTokenization/textMateWorkerTokenizerController.ts -@@ -3,7 +3,6 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - --import { importAMDNodeModule } from '../../../../../amdX.js'; - import { Disposable } from '../../../../../base/common/lifecycle.js'; - import { IObservable, autorun, keepObserved } from '../../../../../base/common/observable.js'; - import { Proxied } from '../../../../../base/common/worker/simpleWorker.js'; -@@ -180,7 +179,7 @@ export class TextMateWorkerTokenizerController extends Disposable { - ); - - if (!this._applyStateStackDiffFn || !this._initialState) { -- const { applyStateStackDiff, INITIAL } = await importAMDNodeModule('vscode-textmate', 'release/main.js'); -+ const { applyStateStackDiff, INITIAL } = await import('vscode-textmate'); - this._applyStateStackDiffFn = applyStateStackDiff; - this._initialState = INITIAL; - } -diff --git a/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker.ts b/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker.ts -index 131ad88d91c..86e236adbac 100644 ---- a/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker.ts -+++ b/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker.ts -@@ -10,7 +10,6 @@ import { ICreateGrammarResult, TMGrammarFactory } from '../../../common/TMGramma - import { IValidEmbeddedLanguagesMap, IValidGrammarDefinition, IValidTokenTypeMap } from '../../../common/TMScopeRegistry.js'; - import type { IOnigLib, IRawTheme, StackDiff } from 'vscode-textmate'; - import { TextMateWorkerTokenizer } from './textMateWorkerTokenizer.js'; --import { importAMDNodeModule } from '../../../../../../amdX.js'; - import { IRequestHandler, IWorkerServer } from '../../../../../../base/common/worker/simpleWorker.js'; - import { TextMateWorkerHost } from './textMateWorkerHost.js'; - -@@ -75,8 +74,8 @@ export class TextMateTokenizationWorker implements IRequestHandler { - } - - private async _loadTMGrammarFactory(grammarDefinitions: IValidGrammarDefinition[], onigurumaWASMUri: string): Promise { -- const vscodeTextmate = await importAMDNodeModule('vscode-textmate', 'release/main.js'); -- const vscodeOniguruma = await importAMDNodeModule('vscode-oniguruma', 'release/main.js'); -+ const vscodeTextmate = await import('vscode-textmate'); -+ const vscodeOniguruma = await import('vscode-oniguruma'); - const response = await fetch(onigurumaWASMUri); - - // Using the response directly only works if the server sets the MIME type 'application/wasm'. -diff --git a/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateWorkerTokenizer.ts b/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateWorkerTokenizer.ts -index f3945c5e8fa..72ffd7ccb06 100644 ---- a/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateWorkerTokenizer.ts -+++ b/src/vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateWorkerTokenizer.ts -@@ -3,7 +3,6 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - --import { importAMDNodeModule } from '../../../../../../amdX.js'; - import { RunOnceScheduler } from '../../../../../../base/common/async.js'; - import { observableValue } from '../../../../../../base/common/observable.js'; - import { setTimeout0 } from '../../../../../../base/common/platform.js'; -@@ -115,7 +114,7 @@ export class TextMateWorkerTokenizer extends MirrorTextModel { - } - - if (!this._diffStateStacksRefEqFn) { -- const { diffStateStacksRefEq } = await importAMDNodeModule('vscode-textmate', 'release/main.js'); -+ const { diffStateStacksRefEq } = await import('vscode-textmate'); - this._diffStateStacksRefEqFn = diffStateStacksRefEq; - } - -diff --git a/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts b/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts -index f22a15bb599..e127415e11a 100644 ---- a/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts -+++ b/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.ts -@@ -3,7 +3,7 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - --import { importAMDNodeModule, resolveAmdNodeModulePath } from '../../../../amdX.js'; -+import { resolveAmdNodeModulePath } from '../../../../amdX.js'; - import { canASAR, isESM } from '../../../../base/common/amd.js'; - import * as dom from '../../../../base/browser/dom.js'; - import { equals as equalArray } from '../../../../base/common/arrays.js'; -@@ -246,7 +246,7 @@ export class TextMateTokenizationFeature extends Disposable implements ITextMate - return this._grammarFactory; - } - -- const [vscodeTextmate, vscodeOniguruma] = await Promise.all([importAMDNodeModule('vscode-textmate', 'release/main.js'), this._getVSCodeOniguruma()]); -+ const [vscodeTextmate, vscodeOniguruma] = await Promise.all([import('vscode-textmate'), this._getVSCodeOniguruma()]); - const onigLib: Promise = Promise.resolve({ - createOnigScanner: (sources: string[]) => vscodeOniguruma.createOnigScanner(sources), - createOnigString: (str: string) => vscodeOniguruma.createOnigString(str) -@@ -357,7 +357,7 @@ export class TextMateTokenizationFeature extends Disposable implements ITextMate - private _getVSCodeOniguruma(): Promise { - if (!this._vscodeOniguruma) { - this._vscodeOniguruma = (async () => { -- const [vscodeOniguruma, wasm] = await Promise.all([importAMDNodeModule('vscode-oniguruma', 'release/main.js'), this._loadVSCodeOnigurumaWASM()]); -+ const [vscodeOniguruma, wasm] = await Promise.all([import('vscode-oniguruma'), this._loadVSCodeOnigurumaWASM()]); - await vscodeOniguruma.loadWASM({ - data: wasm, - print: (str: string) => { -diff --git a/src/vs/workbench/services/textfile/common/encoding.ts b/src/vs/workbench/services/textfile/common/encoding.ts -index c6933952e65..647cb01f9c0 100644 ---- a/src/vs/workbench/services/textfile/common/encoding.ts -+++ b/src/vs/workbench/services/textfile/common/encoding.ts -@@ -5,10 +5,8 @@ - - import { Readable, ReadableStream, newWriteableStream, listenStream } from '../../../../base/common/stream.js'; - import { VSBuffer, VSBufferReadable, VSBufferReadableStream } from '../../../../base/common/buffer.js'; --import { importAMDNodeModule } from '../../../../amdX.js'; - import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; - import { coalesce } from '../../../../base/common/arrays.js'; --import { isESM } from '../../../../base/common/amd.js'; - - export const UTF8 = 'utf8'; - export const UTF8_with_bom = 'utf8bom'; -@@ -83,7 +81,7 @@ class DecoderStream implements IDecoderStream { - static async create(encoding: string): Promise { - let decoder: IDecoderStream | undefined = undefined; - if (encoding !== UTF8) { -- const iconv = await importAMDNodeModule('@vscode/iconv-lite-umd', 'lib/iconv-lite-umd.js'); -+ const iconv = await import('@vscode/iconv-lite-umd'); - decoder = iconv.getDecoder(toNodeEncoding(encoding)); - } else { - const utf8TextDecoder = new TextDecoder(); -@@ -216,7 +214,7 @@ export function toDecodeStream(source: VSBufferReadableStream, options: IDecodeS - } - - export async function toEncodeReadable(readable: Readable, encoding: string, options?: { addBOM?: boolean }): Promise { -- const iconv = await importAMDNodeModule('@vscode/iconv-lite-umd', 'lib/iconv-lite-umd.js'); -+ const iconv = await import('@vscode/iconv-lite-umd'); - const encoder = iconv.getEncoder(toNodeEncoding(encoding), options); - - let bytesWritten = false; -@@ -265,7 +263,7 @@ export async function toEncodeReadable(readable: Readable, encoding: str - } - - export async function encodingExists(encoding: string): Promise { -- const iconv = await importAMDNodeModule('@vscode/iconv-lite-umd', 'lib/iconv-lite-umd.js'); -+ const iconv = await import('@vscode/iconv-lite-umd'); - - return iconv.encodingExists(toNodeEncoding(encoding)); - } -@@ -321,11 +319,7 @@ const IGNORE_ENCODINGS = ['ascii', 'utf-16', 'utf-32']; - * Guesses the encoding from buffer. - */ - async function guessEncodingByBuffer(buffer: VSBuffer, candidateGuessEncodings?: string[]): Promise { -- -- // TODO@bpasero TODO@esm: this used to be `dist/jschardet.min.js`, but we are running into an issue that -- // https://github.com/aadsm/jschardet/pull/96 mitigates. Long-term we should just add minification -- // of dependencies into our build process so that we do not depend on how others are doing it. -- const jschardet = await importAMDNodeModule('jschardet', isESM ? 'dist/jschardet.js' : 'dist/jschardet.min.js'); -+ const jschardet = await import('jschardet'); - - // ensure to limit buffer for guessing due to https://github.com/aadsm/jschardet/issues/53 - const limitedBuffer = buffer.slice(0, AUTO_ENCODING_GUESS_MAX_BYTES); diff --git a/vscode-paches/0016-feat-export-some-classes-and-make-some-methods-acces.patch b/vscode-paches/0016-feat-export-some-classes-and-make-some-methods-acces.patch deleted file mode 100644 index 737e832d..00000000 --- a/vscode-paches/0016-feat-export-some-classes-and-make-some-methods-acces.patch +++ /dev/null @@ -1,516 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:32:31 +0100 -Subject: [PATCH] feat: export some classes and make some methods accessible - ---- - .../actions/browser/actionViewItemService.ts | 2 +- - .../browser/extensionResourceLoaderService.ts | 2 +- - .../api/browser/statusBarExtensionPoint.ts | 2 +- - src/vs/workbench/browser/layout.ts | 10 +++++----- - src/vs/workbench/browser/workbench.ts | 14 +++++++------- - .../debug/browser/extensionHostDebugService.ts | 2 +- - .../contrib/issue/browser/issueTroubleshoot.ts | 6 +++--- - .../contrib/logs/common/defaultLogLevels.ts | 2 +- - .../dialogs/browser/abstractFileDialogService.ts | 2 +- - .../services/dialogs/browser/fileDialogService.ts | 4 ++-- - .../extensionManagement/browser/extensionBisect.ts | 2 +- - .../common/extensionFeaturesManagemetService.ts | 2 +- - .../extensions/browser/extensionService.ts | 6 +++--- - .../extensions/browser/extensionUrlHandler.ts | 2 +- - .../extensions/browser/webWorkerExtensionHost.ts | 2 +- - .../extensions/common/abstractExtensionService.ts | 10 +++++----- - .../keybinding/browser/keybindingService.ts | 2 +- - .../languageStatus/common/languageStatusService.ts | 2 +- - .../services/localization/browser/localeService.ts | 2 +- - .../services/outline/browser/outlineService.ts | 2 +- - .../workbench/services/path/browser/pathService.ts | 2 +- - .../remote/common/remoteExplorerService.ts | 2 +- - .../remote/common/remoteExtensionsScanner.ts | 2 +- - .../terminal/common/embedderTerminalService.ts | 2 +- - .../common/remoteUserDataProfiles.ts | 2 +- - .../userDataSync/common/userDataSyncUtil.ts | 2 +- - 26 files changed, 45 insertions(+), 45 deletions(-) - -diff --git a/src/vs/platform/actions/browser/actionViewItemService.ts b/src/vs/platform/actions/browser/actionViewItemService.ts -index fa5739eec65..07f413b305f 100644 ---- a/src/vs/platform/actions/browser/actionViewItemService.ts -+++ b/src/vs/platform/actions/browser/actionViewItemService.ts -@@ -38,7 +38,7 @@ export class NullActionViewItemService implements IActionViewItemService { - } - } - --class ActionViewItemService implements IActionViewItemService { -+export class ActionViewItemService implements IActionViewItemService { - - declare _serviceBrand: undefined; - -diff --git a/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts b/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts -index 974a3061346..2dd39f783b0 100644 ---- a/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts -+++ b/src/vs/platform/extensionResourceLoader/browser/extensionResourceLoaderService.ts -@@ -14,7 +14,7 @@ import { ILogService } from '../../log/common/log.js'; - import { IConfigurationService } from '../../configuration/common/configuration.js'; - import { AbstractExtensionResourceLoaderService, IExtensionResourceLoaderService } from '../common/extensionResourceLoader.js'; - --class ExtensionResourceLoaderService extends AbstractExtensionResourceLoaderService { -+export class ExtensionResourceLoaderService extends AbstractExtensionResourceLoaderService { - - declare readonly _serviceBrand: undefined; - -diff --git a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts b/src/vs/workbench/api/browser/statusBarExtensionPoint.ts -index bae2812c5f3..022b7ff6e54 100644 ---- a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts -+++ b/src/vs/workbench/api/browser/statusBarExtensionPoint.ts -@@ -57,7 +57,7 @@ export interface IExtensionStatusBarItemService { - } - - --class ExtensionStatusBarItemService implements IExtensionStatusBarItemService { -+export class ExtensionStatusBarItemService implements IExtensionStatusBarItemService { - - declare readonly _serviceBrand: undefined; - -diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts -index 7290a2f7076..2e07af10fae 100644 ---- a/src/vs/workbench/browser/layout.ts -+++ b/src/vs/workbench/browser/layout.ts -@@ -51,7 +51,7 @@ import { CodeWindow, mainWindow } from '../../base/browser/window.js'; - - //#region Layout Implementation - --interface ILayoutRuntimeState { -+export interface ILayoutRuntimeState { - activeContainerId: number; - mainWindowFullscreen: boolean; - readonly maximized: Set; -@@ -65,12 +65,12 @@ interface ILayoutRuntimeState { - }; - } - --interface IEditorToOpen { -+export interface IEditorToOpen { - readonly editor: IUntypedEditorInput; - readonly viewColumn?: number; - } - --interface ILayoutInitializationState { -+export interface ILayoutInitializationState { - readonly views: { - readonly defaults: string[] | undefined; - readonly containerToRestore: { -@@ -104,11 +104,11 @@ enum LayoutClasses { - WINDOW_BORDER = 'border' - } - --interface IPathToOpen extends IPath { -+export interface IPathToOpen extends IPath { - readonly viewColumn?: number; - } - --interface IInitialEditorsState { -+export interface IInitialEditorsState { - readonly filesToOpenOrCreate?: IPathToOpen[]; - readonly filesToDiff?: IPathToOpen[]; - readonly filesToMerge?: IPathToOpen[]; -diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts -index f081430e49f..cf237f2df62 100644 ---- a/src/vs/workbench/browser/workbench.ts -+++ b/src/vs/workbench/browser/workbench.ts -@@ -82,7 +82,7 @@ export class Workbench extends Layout { - this.registerErrorHandler(logService); - } - -- private registerErrorHandler(logService: ILogService): void { -+ protected registerErrorHandler(logService: ILogService): void { - - // Listen on unhandled rejection events - // Note: intentionally not registered as disposable to handle -@@ -126,7 +126,7 @@ export class Workbench extends Layout { - } - - private previousUnexpectedError: { message: string | undefined; time: number } = { message: undefined, time: 0 }; -- private handleUnexpectedError(error: unknown, logService: ILogService): void { -+ protected handleUnexpectedError(error: unknown, logService: ILogService): void { - const message = toErrorMessage(error, true); - if (!message) { - return; -@@ -201,7 +201,7 @@ export class Workbench extends Layout { - } - } - -- private initServices(serviceCollection: ServiceCollection): IInstantiationService { -+ protected initServices(serviceCollection: ServiceCollection): IInstantiationService { - - // Layout Service - serviceCollection.set(IWorkbenchLayoutService, this); -@@ -240,7 +240,7 @@ export class Workbench extends Layout { - return instantiationService; - } - -- private registerListeners(lifecycleService: ILifecycleService, storageService: IStorageService, configurationService: IConfigurationService, hostService: IHostService, dialogService: IDialogService): void { -+ protected registerListeners(lifecycleService: ILifecycleService, storageService: IStorageService, configurationService: IConfigurationService, hostService: IHostService, dialogService: IDialogService): void { - - // Configuration changes - this._register(configurationService.onDidChangeConfiguration(e => this.updateFontAliasing(e, configurationService))); -@@ -329,7 +329,7 @@ export class Workbench extends Layout { - } - } - -- private renderWorkbench(instantiationService: IInstantiationService, notificationService: NotificationService, storageService: IStorageService, configurationService: IConfigurationService): void { -+ protected renderWorkbench(instantiationService: IInstantiationService, notificationService: NotificationService, storageService: IStorageService, configurationService: IConfigurationService): void { - - // ARIA & Signals - setARIAContainer(this.mainContainer); -@@ -396,7 +396,7 @@ export class Workbench extends Layout { - return part; - } - -- private createNotificationsHandlers(instantiationService: IInstantiationService, notificationService: NotificationService): void { -+ protected createNotificationsHandlers(instantiationService: IInstantiationService, notificationService: NotificationService): void { - - // Instantiate Notification components - const notificationsCenter = this._register(instantiationService.createInstance(NotificationsCenter, this.mainContainer, notificationService.model)); -@@ -427,7 +427,7 @@ export class Workbench extends Layout { - }); - } - -- private restore(lifecycleService: ILifecycleService): void { -+ protected restore(lifecycleService: ILifecycleService): void { - - // Ask each part to restore - try { -diff --git a/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.ts b/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.ts -index 4cd6bb2b089..31330c7b15f 100644 ---- a/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.ts -+++ b/src/vs/workbench/contrib/debug/browser/extensionHostDebugService.ts -@@ -19,7 +19,7 @@ import { IBrowserWorkbenchEnvironmentService } from '../../../services/environme - import { IHostService } from '../../../services/host/browser/host.js'; - import { IRemoteAgentService } from '../../../services/remote/common/remoteAgentService.js'; - --class BrowserExtensionHostDebugService extends ExtensionHostDebugChannelClient implements IExtensionHostDebugService { -+export class BrowserExtensionHostDebugService extends ExtensionHostDebugChannelClient implements IExtensionHostDebugService { - - private static readonly LAST_EXTENSION_DEVELOPMENT_WORKSPACE_KEY = 'debug.lastExtensionDevelopmentWorkspace'; - -diff --git a/src/vs/workbench/contrib/issue/browser/issueTroubleshoot.ts b/src/vs/workbench/contrib/issue/browser/issueTroubleshoot.ts -index facb8ee9d9f..e3d80d62340 100644 ---- a/src/vs/workbench/contrib/issue/browser/issueTroubleshoot.ts -+++ b/src/vs/workbench/contrib/issue/browser/issueTroubleshoot.ts -@@ -30,9 +30,9 @@ import { URI } from '../../../../base/common/uri.js'; - import { RemoteNameContext } from '../../../common/contextkeys.js'; - import { IsWebContext } from '../../../../platform/contextkey/common/contextkeys.js'; - --const ITroubleshootIssueService = createDecorator('ITroubleshootIssueService'); -+export const ITroubleshootIssueService = createDecorator('ITroubleshootIssueService'); - --interface ITroubleshootIssueService { -+export interface ITroubleshootIssueService { - _serviceBrand: undefined; - isActive(): boolean; - start(): Promise; -@@ -72,7 +72,7 @@ class TroubleShootState { - ) { } - } - --class TroubleshootIssueService extends Disposable implements ITroubleshootIssueService { -+export class TroubleshootIssueService extends Disposable implements ITroubleshootIssueService { - - readonly _serviceBrand: undefined; - -diff --git a/src/vs/workbench/contrib/logs/common/defaultLogLevels.ts b/src/vs/workbench/contrib/logs/common/defaultLogLevels.ts -index 1302428ebdf..670089148d4 100644 ---- a/src/vs/workbench/contrib/logs/common/defaultLogLevels.ts -+++ b/src/vs/workbench/contrib/logs/common/defaultLogLevels.ts -@@ -42,7 +42,7 @@ export interface IDefaultLogLevelsService { - migrateLogLevels(): void; - } - --class DefaultLogLevelsService extends Disposable implements IDefaultLogLevelsService { -+export class DefaultLogLevelsService extends Disposable implements IDefaultLogLevelsService { - - _serviceBrand: undefined; - -diff --git a/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.ts b/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.ts -index c7e890fce1d..9c993aea259 100644 ---- a/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.ts -+++ b/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.ts -@@ -54,7 +54,7 @@ export abstract class AbstractFileDialogService implements IFileDialogService { - @ICommandService protected readonly commandService: ICommandService, - @IEditorService protected readonly editorService: IEditorService, - @ICodeEditorService protected readonly codeEditorService: ICodeEditorService, -- @ILogService private readonly logService: ILogService -+ @ILogService protected readonly logService: ILogService - ) { } - - async defaultFilePath(schemeFilter = this.getSchemeFilterForWindow(), authorityFilter = this.getAuthorityFilterForWindow()): Promise { -diff --git a/src/vs/workbench/services/dialogs/browser/fileDialogService.ts b/src/vs/workbench/services/dialogs/browser/fileDialogService.ts -index 70d9dc6f979..12f9e2b5ed7 100644 ---- a/src/vs/workbench/services/dialogs/browser/fileDialogService.ts -+++ b/src/vs/workbench/services/dialogs/browser/fileDialogService.ts -@@ -24,7 +24,7 @@ import { EmbeddedCodeEditorWidget } from '../../../../editor/browser/widget/code - export class FileDialogService extends AbstractFileDialogService implements IFileDialogService { - - @memoize -- private get fileSystemProvider(): HTMLFileSystemProvider { -+ protected get fileSystemProvider(): HTMLFileSystemProvider { - return this.fileService.getProvider(Schemas.file) as HTMLFileSystemProvider; - } - -@@ -271,7 +271,7 @@ export class FileDialogService extends AbstractFileDialogService implements IFil - return undefined; - } - -- private shouldUseSimplified(scheme: string): boolean { -+ protected shouldUseSimplified(scheme: string): boolean { - return ![Schemas.file, Schemas.vscodeUserData, Schemas.tmp].includes(scheme); - } - } -diff --git a/src/vs/workbench/services/extensionManagement/browser/extensionBisect.ts b/src/vs/workbench/services/extensionManagement/browser/extensionBisect.ts -index 940a4e0ce46..881aebdeb5c 100644 ---- a/src/vs/workbench/services/extensionManagement/browser/extensionBisect.ts -+++ b/src/vs/workbench/services/extensionManagement/browser/extensionBisect.ts -@@ -64,7 +64,7 @@ class BisectState { - ) { } - } - --class ExtensionBisectService implements IExtensionBisectService { -+export class ExtensionBisectService implements IExtensionBisectService { - - declare readonly _serviceBrand: undefined; - -diff --git a/src/vs/workbench/services/extensionManagement/common/extensionFeaturesManagemetService.ts b/src/vs/workbench/services/extensionManagement/common/extensionFeaturesManagemetService.ts -index 4eeb0851a4d..29592880548 100644 ---- a/src/vs/workbench/services/extensionManagement/common/extensionFeaturesManagemetService.ts -+++ b/src/vs/workbench/services/extensionManagement/common/extensionFeaturesManagemetService.ts -@@ -27,7 +27,7 @@ interface IExtensionFeatureState { - - const FEATURES_STATE_KEY = 'extension.features.state'; - --class ExtensionFeaturesManagementService extends Disposable implements IExtensionFeaturesManagementService { -+export class ExtensionFeaturesManagementService extends Disposable implements IExtensionFeaturesManagementService { - declare readonly _serviceBrand: undefined; - - private readonly _onDidChangeEnablement = this._register(new Emitter<{ extension: ExtensionIdentifier; featureId: string; enabled: boolean }>()); -diff --git a/src/vs/workbench/services/extensions/browser/extensionService.ts b/src/vs/workbench/services/extensions/browser/extensionService.ts -index 818514fdd22..b232937c792 100644 ---- a/src/vs/workbench/services/extensions/browser/extensionService.ts -+++ b/src/vs/workbench/services/extensions/browser/extensionService.ts -@@ -117,7 +117,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten - this._register(this._fileService.registerProvider(Schemas.https, provider)); - } - -- private async _scanWebExtensions(): Promise { -+ protected async _scanWebExtensions(): Promise { - const system: IExtensionDescription[] = [], user: IExtensionDescription[] = [], development: IExtensionDescription[] = []; - try { - await Promise.all([ -@@ -200,7 +200,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten - } - } - --class BrowserExtensionHostFactory implements IExtensionHostFactory { -+export class BrowserExtensionHostFactory implements IExtensionHostFactory { - - constructor( - private readonly _extensionsProposedApi: ExtensionsProposedApi, -@@ -236,7 +236,7 @@ class BrowserExtensionHostFactory implements IExtensionHostFactory { - } - } - -- private _createLocalExtensionHostDataProvider(runningLocations: ExtensionRunningLocationTracker, desiredRunningLocation: ExtensionRunningLocation, isInitialStart: boolean): IWebWorkerExtensionHostDataProvider { -+ protected _createLocalExtensionHostDataProvider(runningLocations: ExtensionRunningLocationTracker, desiredRunningLocation: ExtensionRunningLocation, isInitialStart: boolean): IWebWorkerExtensionHostDataProvider { - return { - getInitData: async (): Promise => { - if (isInitialStart) { -diff --git a/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts b/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts -index ac3c7ed5006..94663c3cde9 100644 ---- a/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts -+++ b/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts -@@ -108,7 +108,7 @@ type ExtensionUrlReloadHandlerClassification = { - * - * It also makes sure the user confirms opening URLs directed towards extensions. - */ --class ExtensionUrlHandler implements IExtensionUrlHandler, IURLHandler { -+export class ExtensionUrlHandler implements IExtensionUrlHandler, IURLHandler { - - readonly _serviceBrand: undefined; - -diff --git a/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts b/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts -index cecd70c21af..8141d1dfe02 100644 ---- a/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts -+++ b/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts -@@ -78,7 +78,7 @@ export class WebWorkerExtensionHost extends Disposable implements IExtensionHost - this._extensionHostLogsLocation = joinPath(this._environmentService.extHostLogsPath, 'webWorker'); - } - -- private async _getWebWorkerExtensionHostIframeSrc(): Promise { -+ protected async _getWebWorkerExtensionHostIframeSrc(): Promise { - const suffixSearchParams = new URLSearchParams(); - if (this._environmentService.debugExtensionHost && this._environmentService.debugRenderer) { - suffixSearchParams.set('debugged', '1'); -diff --git a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts -index 0479473dcaa..9fa2663f0e5 100644 ---- a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts -+++ b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts -@@ -95,9 +95,9 @@ export abstract class AbstractExtensionService extends Disposable implements IEx - private _resolveAuthorityAttempt: number = 0; - - constructor( -- private readonly _extensionsProposedApi: ExtensionsProposedApi, -- private readonly _extensionHostFactory: IExtensionHostFactory, -- private readonly _extensionHostKindPicker: IExtensionHostKindPicker, -+ protected readonly _extensionsProposedApi: ExtensionsProposedApi, -+ protected readonly _extensionHostFactory: IExtensionHostFactory, -+ protected readonly _extensionHostKindPicker: IExtensionHostKindPicker, - @IInstantiationService protected readonly _instantiationService: IInstantiationService, - @INotificationService protected readonly _notificationService: INotificationService, - @IWorkbenchEnvironmentService protected readonly _environmentService: IWorkbenchEnvironmentService, -@@ -224,7 +224,7 @@ export abstract class AbstractExtensionService extends Disposable implements IEx - - //#region deltaExtensions - -- private async _handleDeltaExtensions(item: DeltaExtensionsQueueItem): Promise { -+ protected async _handleDeltaExtensions(item: DeltaExtensionsQueueItem): Promise { - this._deltaExtensionsQueue.push(item); - if (this._inHandleDeltaExtensions) { - // Let the current item finish, the new one will be picked up -@@ -1289,7 +1289,7 @@ export interface IExtensionHostFactory { - createExtensionHost(runningLocations: ExtensionRunningLocationTracker, runningLocation: ExtensionRunningLocation, isInitialStart: boolean): IExtensionHost | null; - } - --class DeltaExtensionsQueueItem { -+export class DeltaExtensionsQueueItem { - constructor( - public readonly toAdd: IExtension[], - public readonly toRemove: string[] | IExtension[] -diff --git a/src/vs/workbench/services/keybinding/browser/keybindingService.ts b/src/vs/workbench/services/keybinding/browser/keybindingService.ts -index de6fc38cd0a..320c2526b7a 100644 ---- a/src/vs/workbench/services/keybinding/browser/keybindingService.ts -+++ b/src/vs/workbench/services/keybinding/browser/keybindingService.ts -@@ -423,7 +423,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService { - return this.userKeybindings.keybindings.length; - } - -- private updateResolver(): void { -+ protected updateResolver(): void { - this._cachedResolver = null; - this._onDidUpdateKeybindings.fire(); - } -diff --git a/src/vs/workbench/services/languageStatus/common/languageStatusService.ts b/src/vs/workbench/services/languageStatus/common/languageStatusService.ts -index 74bfa68e6a8..848e3846c1f 100644 ---- a/src/vs/workbench/services/languageStatus/common/languageStatusService.ts -+++ b/src/vs/workbench/services/languageStatus/common/languageStatusService.ts -@@ -47,7 +47,7 @@ export interface ILanguageStatusService { - } - - --class LanguageStatusServiceImpl implements ILanguageStatusService { -+export class LanguageStatusServiceImpl implements ILanguageStatusService { - - declare _serviceBrand: undefined; - -diff --git a/src/vs/workbench/services/localization/browser/localeService.ts b/src/vs/workbench/services/localization/browser/localeService.ts -index 554ecb2bce9..63082ed6952 100644 ---- a/src/vs/workbench/services/localization/browser/localeService.ts -+++ b/src/vs/workbench/services/localization/browser/localeService.ts -@@ -109,7 +109,7 @@ export class WebLocaleService implements ILocaleService { - } - } - --class WebActiveLanguagePackService implements IActiveLanguagePackService { -+export class WebActiveLanguagePackService implements IActiveLanguagePackService { - _serviceBrand: undefined; - - constructor( -diff --git a/src/vs/workbench/services/outline/browser/outlineService.ts b/src/vs/workbench/services/outline/browser/outlineService.ts -index e9077d5f226..fc31a3fab94 100644 ---- a/src/vs/workbench/services/outline/browser/outlineService.ts -+++ b/src/vs/workbench/services/outline/browser/outlineService.ts -@@ -11,7 +11,7 @@ import { IEditorPane } from '../../../common/editor.js'; - import { IOutline, IOutlineCreator, IOutlineService, OutlineTarget } from './outline.js'; - import { Event, Emitter } from '../../../../base/common/event.js'; - --class OutlineService implements IOutlineService { -+export class OutlineService implements IOutlineService { - - declare _serviceBrand: undefined; - -diff --git a/src/vs/workbench/services/path/browser/pathService.ts b/src/vs/workbench/services/path/browser/pathService.ts -index ac35093bc65..12cedea8f20 100644 ---- a/src/vs/workbench/services/path/browser/pathService.ts -+++ b/src/vs/workbench/services/path/browser/pathService.ts -@@ -27,7 +27,7 @@ export class BrowserPathService extends AbstractPathService { - } - } - --function guessLocalUserHome(environmentService: IWorkbenchEnvironmentService, contextService: IWorkspaceContextService): URI { -+export function guessLocalUserHome(environmentService: IWorkbenchEnvironmentService, contextService: IWorkspaceContextService): URI { - - // In web we do not really have the concept of a "local" user home - // but we still require it in many places as a fallback. As such, -diff --git a/src/vs/workbench/services/remote/common/remoteExplorerService.ts b/src/vs/workbench/services/remote/common/remoteExplorerService.ts -index cbf78719a20..2b6fb4c4f05 100644 ---- a/src/vs/workbench/services/remote/common/remoteExplorerService.ts -+++ b/src/vs/workbench/services/remote/common/remoteExplorerService.ts -@@ -145,7 +145,7 @@ export interface IRemoteExplorerService { - readonly namedProcesses: Map; - } - --class RemoteExplorerService implements IRemoteExplorerService { -+export class RemoteExplorerService implements IRemoteExplorerService { - public _serviceBrand: undefined; - private _targetType: string[] = []; - private readonly _onDidChangeTargetType: Emitter = new Emitter(); -diff --git a/src/vs/workbench/services/remote/common/remoteExtensionsScanner.ts b/src/vs/workbench/services/remote/common/remoteExtensionsScanner.ts -index 0a54b54e489..85428cc7600 100644 ---- a/src/vs/workbench/services/remote/common/remoteExtensionsScanner.ts -+++ b/src/vs/workbench/services/remote/common/remoteExtensionsScanner.ts -@@ -18,7 +18,7 @@ import { IActiveLanguagePackService } from '../../localization/common/locale.js' - import { IWorkbenchExtensionManagementService } from '../../extensionManagement/common/extensionManagement.js'; - import { Mutable } from '../../../../base/common/types.js'; - --class RemoteExtensionsScannerService implements IRemoteExtensionsScannerService { -+export class RemoteExtensionsScannerService implements IRemoteExtensionsScannerService { - - declare readonly _serviceBrand: undefined; - -diff --git a/src/vs/workbench/services/terminal/common/embedderTerminalService.ts b/src/vs/workbench/services/terminal/common/embedderTerminalService.ts -index e976a8617ca..b855f41710f 100644 ---- a/src/vs/workbench/services/terminal/common/embedderTerminalService.ts -+++ b/src/vs/workbench/services/terminal/common/embedderTerminalService.ts -@@ -52,7 +52,7 @@ export interface IEmbedderTerminalPty { - // setDimensions?(dimensions: TerminalDimensions): void; - } - --class EmbedderTerminalService implements IEmbedderTerminalService { -+export class EmbedderTerminalService implements IEmbedderTerminalService { - declare _serviceBrand: undefined; - - private readonly _onDidCreateTerminal = new Emitter(); -diff --git a/src/vs/workbench/services/userDataProfile/common/remoteUserDataProfiles.ts b/src/vs/workbench/services/userDataProfile/common/remoteUserDataProfiles.ts -index 65ca63829ec..0dd7d367fdd 100644 ---- a/src/vs/workbench/services/userDataProfile/common/remoteUserDataProfiles.ts -+++ b/src/vs/workbench/services/userDataProfile/common/remoteUserDataProfiles.ts -@@ -25,7 +25,7 @@ export interface IRemoteUserDataProfilesService { - getRemoteProfile(localProfile: IUserDataProfile): Promise; - } - --class RemoteUserDataProfilesService extends Disposable implements IRemoteUserDataProfilesService { -+export class RemoteUserDataProfilesService extends Disposable implements IRemoteUserDataProfilesService { - - readonly _serviceBrand: undefined; - -diff --git a/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.ts b/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.ts -index dc5f8232d0e..1cec5236244 100644 ---- a/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.ts -+++ b/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.ts -@@ -12,7 +12,7 @@ import { URI } from '../../../../base/common/uri.js'; - import { ITextModelService } from '../../../../editor/common/services/resolverService.js'; - import { ITextResourcePropertiesService, ITextResourceConfigurationService } from '../../../../editor/common/services/textResourceConfiguration.js'; - --class UserDataSyncUtilService implements IUserDataSyncUtilService { -+export class UserDataSyncUtilService implements IUserDataSyncUtilService { - - declare readonly _serviceBrand: undefined; - diff --git a/vscode-paches/0017-fix-improve-extension-contribution-types.patch b/vscode-paches/0017-fix-improve-extension-contribution-types.patch deleted file mode 100644 index 9f8e1a76..00000000 --- a/vscode-paches/0017-fix-improve-extension-contribution-types.patch +++ /dev/null @@ -1,1672 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:38:30 +0100 -Subject: [PATCH] fix: improve extension contribution types - ---- - .../platform/extensions/common/extensions.ts | 1497 ++++++++++++++++- - .../services/search/common/queryBuilder.ts | 8 +- - .../themes/common/colorExtensionPoint.ts | 2 +- - .../tokenClassificationExtensionPoint.ts | 1 + - 4 files changed, 1432 insertions(+), 76 deletions(-) - -diff --git a/src/vs/platform/extensions/common/extensions.ts b/src/vs/platform/extensions/common/extensions.ts -index 5973d4dcf12..d0cc0b03bcd 100644 ---- a/src/vs/platform/extensions/common/extensions.ts -+++ b/src/vs/platform/extensions/common/extensions.ts -@@ -3,6 +3,7 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -+import { IJSONSchema } from '../../../base/common/jsonSchema.js'; - import Severity from '../../../base/common/severity.js'; - import * as strings from '../../../base/common/strings.js'; - import { URI } from '../../../base/common/uri.js'; -@@ -16,118 +17,593 @@ export const BUILTIN_MANIFEST_CACHE_FILE = 'extensions.builtin.cache'; - export const UNDEFINED_PUBLISHER = 'undefined_publisher'; - - export interface ICommand { -- command: string; -- title: string | ILocalizedString; -- category?: string | ILocalizedString; -+ /** -+ * Identifier of the command to execute -+ */ -+ readonly command: string; -+ /** -+ * Title by which the command is represented in the UI -+ */ -+ readonly title: string | ILocalizedString; -+ readonly shortTitle?: string; -+ /** -+ * (Optional) Category string by which the command is grouped in the UI -+ */ -+ readonly category?: string | ILocalizedString; -+ /** -+ * (Optional) Condition which must be true to enable the command in the UI (menu and keybindings). Does not prevent executing the command by other means, like the `executeCommand`-api. -+ */ -+ readonly enablement?: string; -+ /** -+ * (Optional) Icon which is used to represent the command in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\$(zap)` -+ */ -+ readonly icon?: -+ | string -+ | { -+ /** -+ * Icon path when a light theme is used -+ */ -+ readonly light?: string; -+ /** -+ * Icon path when a dark theme is used -+ */ -+ readonly dark?: string; -+ }; - } - - export interface IDebugger { -- label?: string; -- type: string; -- runtime?: string; -+ /** -+ * Unique identifier for this debug adapter. -+ */ -+ readonly type: string; -+ /** -+ * Display name for this debug adapter. -+ */ -+ readonly label?: string; -+ /** -+ * Path to the debug adapter program. Path is either absolute or relative to the extension folder. -+ */ -+ readonly program?: string; -+ /** -+ * Optional arguments to pass to the adapter. -+ */ -+ readonly args?: unknown[]; -+ /** -+ * Optional runtime in case the program attribute is not an executable but requires a runtime. -+ */ -+ readonly runtime?: string; -+ /** -+ * Optional runtime arguments. -+ */ -+ readonly runtimeArgs?: unknown[]; -+ /** -+ * Mapping from interactive variables (e.g. ${action.pickProcess}) in `launch.json` to a command. -+ */ -+ readonly variables?: {}; -+ /** -+ * Configurations for generating the initial 'launch.json'. -+ */ -+ readonly initialConfigurations?: unknown[] | string; -+ /** -+ * List of languages for which the debug extension could be considered the "default debugger". -+ */ -+ readonly languages?: unknown[]; -+ /** -+ * Snippets for adding new configurations in 'launch.json'. -+ */ -+ readonly configurationSnippets?: unknown[]; -+ /** -+ * JSON schema configurations for validating 'launch.json'. -+ */ -+ readonly configurationAttributes?: {}; -+ /** -+ * Condition which must be true to enable this type of debugger. Consider using 'shellExecutionSupported', 'virtualWorkspace', 'resourceScheme' or an extension-defined context key as appropriate for this. -+ */ -+ readonly when?: string; -+ /** -+ * When this condition is true, this debugger type is hidden from the debugger list, but is still enabled. -+ */ -+ readonly hiddenWhen?: string; -+ /** -+ * Optional message to mark this debug type as being deprecated. -+ */ -+ readonly deprecated?: string; -+ /** -+ * Windows specific settings. -+ */ -+ readonly windows?: { -+ /** -+ * Runtime used for Windows. -+ */ -+ runtime?: string; -+ }; -+ /** -+ * macOS specific settings. -+ */ -+ readonly osx?: { -+ /** -+ * Runtime used for macOS. -+ */ -+ runtime?: string; -+ }; -+ /** -+ * Linux specific settings. -+ */ -+ readonly linux?: { -+ /** -+ * Runtime used for Linux. -+ */ -+ readonly runtime?: string; -+ }; -+ /** -+ * UI strings contributed by this debug adapter. -+ */ -+ readonly strings?: { -+ /** -+ * When there are unverified breakpoints in a language supported by this debug adapter, this message will appear on the breakpoint hover and in the breakpoints view. Markdown and command links are supported. -+ */ -+ readonly unverifiedBreakpoints?: string; -+ }; - } - - export interface IGrammar { -- language?: string; -+ /** -+ * Language identifier for which this syntax is contributed to. -+ */ -+ readonly language?: string; -+ /** -+ * Textmate scope name used by the tmLanguage file. -+ */ -+ readonly scopeName: string; -+ /** -+ * Path of the tmLanguage file. The path is relative to the extension folder and typically starts with './syntaxes/'. -+ */ -+ readonly path: string; -+ /** -+ * A map of scope name to language id if this grammar contains embedded languages. -+ */ -+ readonly embeddedLanguages?: {}; -+ /** -+ * A map of scope name to token types. -+ */ -+ readonly tokenTypes?: { -+ [k: string]: 'string' | 'comment' | 'other'; -+ }; -+ /** -+ * List of language scope names to which this grammar is injected to. -+ */ -+ readonly injectTo?: string[]; -+ /** -+ * Defines which scope names contain balanced brackets. -+ */ -+ readonly balancedBracketScopes?: string[]; -+ /** -+ * Defines which scope names do not contain balanced brackets. -+ */ -+ readonly unbalancedBracketScopes?: string[]; - } - - export interface IJSONValidation { -- fileMatch: string | string[]; -- url: string; -+ /** -+ * The file pattern (or an array of patterns) to match, for example "package.json" or "*.launch". Exclusion patterns start with '!' -+ */ -+ readonly fileMatch?: string | string[]; -+ /** -+ * A schema URL ('http:', 'https:') or relative path to the extension folder ('./'). -+ */ -+ readonly url: string; - } - - export interface IKeyBinding { -- command: string; -- key: string; -- when?: string; -- mac?: string; -- linux?: string; -- win?: string; -+ /** -+ * Identifier of the command to run when keybinding is triggered. -+ */ -+ readonly command: string; -+ /** -+ * Arguments to pass to the command to execute. -+ */ -+ readonly args?: { -+ [k: string]: unknown; -+ }; -+ /** -+ * Key or key sequence (separate keys with plus-sign and sequences with space, e.g. Ctrl+O and Ctrl+L L for a chord). -+ */ -+ readonly key: string; -+ /** -+ * Mac specific key or key sequence. -+ */ -+ readonly mac?: string; -+ /** -+ * Linux specific key or key sequence. -+ */ -+ readonly linux?: string; -+ /** -+ * Windows specific key or key sequence. -+ */ -+ readonly win?: string; -+ /** -+ * Condition when the key is active. -+ */ -+ readonly when?: string; - } - - export interface ILanguage { -- id: string; -- extensions: string[]; -- aliases: string[]; -+ /** -+ * ID of the language. -+ */ -+ readonly id: string; -+ /** -+ * Name aliases for the language. -+ */ -+ readonly aliases?: string[]; -+ /** -+ * File extensions associated to the language. -+ */ -+ readonly extensions?: string[]; -+ /** -+ * File names associated to the language. -+ */ -+ readonly filenames?: string[]; -+ /** -+ * File name glob patterns associated to the language. -+ */ -+ readonly filenamePatterns?: string[]; -+ /** -+ * Mime types associated to the language. -+ */ -+ readonly mimetypes?: string[]; -+ /** -+ * A regular expression matching the first line of a file of the language. -+ */ -+ readonly firstLine?: string; -+ /** -+ * A relative path to a file containing configuration options for the language. -+ */ -+ readonly configuration?: string; -+ /** -+ * A icon to use as file icon, if no icon theme provides one for the language. -+ */ -+ readonly icon?: { -+ /** -+ * Icon path when a light theme is used -+ */ -+ readonly light?: string; -+ /** -+ * Icon path when a dark theme is used -+ */ -+ readonly dark?: string; -+ }; - } - - export interface IMenu { -- command: string; -- alt?: string; -- when?: string; -- group?: string; -+ /** -+ * Identifier of the command to execute. The command must be declared in the 'commands'-section -+ */ -+ readonly command: string; -+ /** -+ * Identifier of an alternative command to execute. The command must be declared in the 'commands'-section -+ */ -+ readonly alt?: string; -+ /** -+ * Condition which must be true to show this item -+ */ -+ readonly when?: string; -+ /** -+ * Group into which this item belongs -+ */ -+ readonly group?: string; -+} -+ -+export interface ISubMenu { -+ /** -+ * Identifier of the submenu to display in this item. -+ */ -+ readonly submenu: string; -+ /** -+ * Condition which must be true to show this item -+ */ -+ readonly when?: string; -+ /** -+ * Group into which this item belongs -+ */ -+ readonly group?: string; - } - - export interface ISnippet { -- language: string; -+ /** -+ * Language identifier for which this snippet is contributed to. -+ */ -+ readonly language: string; -+ /** -+ * Path of the snippets file. The path is relative to the extension folder and typically starts with './snippets/'. -+ */ -+ readonly path: string; -+} -+ -+export interface IColorTheme { -+ /** -+ * Id of the color theme as used in the user settings. -+ */ -+ readonly id: string; -+ /** -+ * Label of the color theme as shown in the UI. -+ */ -+ readonly label: string; -+ /** -+ * Base theme defining the colors around the editor: 'vs' is the light color theme, 'vs-dark' is the dark color theme. 'hc-black' is the dark high contrast theme, 'hc-light' is the light high contrast theme. -+ */ -+ readonly uiTheme: 'vs' | 'vs-dark' | 'hc-black' | 'hc-light'; -+ /** -+ * Path of the tmTheme file. The path is relative to the extension folder and is typically './colorthemes/awesome-color-theme.json'. -+ */ -+ readonly path: string; -+} -+ -+export interface IIconTheme { -+ /** -+ * Id of the file icon theme as used in the user settings. -+ */ -+ readonly id: string; -+ /** -+ * Label of the file icon theme as shown in the UI. -+ */ -+ readonly label: string; -+ /** -+ * Path of the file icon theme definition file. The path is relative to the extension folder and is typically './fileicons/awesome-icon-theme.json'. -+ */ -+ readonly path: string; - } - --export interface ITheme { -- label: string; -+export interface IProductTheme { -+ /** -+ * Id of the product icon theme as used in the user settings. -+ */ -+ readonly id: string; -+ /** -+ * Label of the product icon theme as shown in the UI. -+ */ -+ readonly label: string; -+ /** -+ * Path of the product icon theme definition file. The path is relative to the extension folder and is typically './producticons/awesome-product-icon-theme.json'. -+ */ -+ readonly path: string; - } - - export interface IViewContainer { -- id: string; -- title: string; -+ /** -+ * Unique id used to identify the container in which views can be contributed using 'views' contribution point -+ */ -+ readonly id: string; -+ /** -+ * Human readable string used to render the container -+ */ -+ readonly title: string; -+ /** -+ * Path to the container icon. Icons are 24x24 centered on a 50x40 block and have a fill color of 'rgb(215, 218, 224)' or '#d7dae0'. It is recommended that icons be in SVG, though any image file type is accepted. -+ */ -+ readonly icon: string; - } - - export interface IView { -- id: string; -- name: string; -+ readonly type?: 'tree' | 'webview'; -+ readonly id: string; -+ /** -+ * The human-readable name of the view. Will be shown -+ */ -+ readonly name: string; -+ /** -+ * Condition which must be true to show this view -+ */ -+ readonly when?: string; -+ /** -+ * Path to the view icon. View icons are displayed when the name of the view cannot be shown. It is recommended that icons be in SVG, though any image file type is accepted. -+ */ -+ readonly icon?: string; -+ /** -+ * Human-readable context for when the view is moved out of its original location. By default, the view's container name will be used. -+ */ -+ readonly contextualTitle?: string; -+ /** -+ * Initial state of the view when the extension is first installed. Once the user has changed the view state by collapsing, moving, or hiding the view, the initial state will not be used again. -+ */ -+ readonly visibility?: 'visible' | 'hidden' | 'collapsed'; -+ /** -+ * The initial size of the view. The size will behave like the css 'flex' property, and will set the initial size when the view is first shown. In the side bar, this is the height of the view. This value is only respected when the same extension owns both the view and the view container. -+ */ -+ readonly initialSize?: number; - } - - export interface IColor { -- id: string; -- description: string; -- defaults: { light: string; dark: string; highContrast: string }; -+ /** -+ * The identifier of the themable color -+ */ -+ readonly id: string; -+ /** -+ * The description of the themable color -+ */ -+ readonly description: string; -+ readonly defaults: { -+ /** -+ * The default color for light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. -+ */ -+ readonly light: string; -+ /** -+ * The default color for dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. -+ */ -+ readonly dark: string; -+ /** -+ * The default color for high contrast dark themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `dark` color is used as default for high contrast dark themes. -+ */ -+ readonly highContrast?: string; -+ /** -+ * The default color for high contrast light themes. Either a color value in hex (#RRGGBB[AA]) or the identifier of a themable color which provides the default. If not provided, the `light` color is used as default for high contrast light themes. -+ */ -+ readonly highContrastLight?: string; -+ }; - } - - interface IWebviewEditor { - readonly viewType: string; - readonly priority: string; -- readonly selector: readonly { -+ /** -+ * Human readable name of the custom editor. This is displayed to users when selecting which editor to use. -+ */ -+ readonly displayName: string; -+ /** -+ * Set of globs that the custom editor is enabled for. -+ */ -+ readonly selector: { -+ /** -+ * Glob that the custom editor is enabled for. -+ */ - readonly filenamePattern?: string; - }[]; - } - - export interface ICodeActionContributionAction { - readonly kind: string; -+ /** -+ * Label for the code action used in the UI. -+ */ - readonly title: string; -+ /** -+ * Description of what the code action does. -+ */ - readonly description?: string; - } - - export interface ICodeActionContribution { -- readonly languages: readonly string[]; -+ /** -+ * Language modes that the code actions are enabled for. -+ */ -+ readonly languages: string[]; - readonly actions: readonly ICodeActionContributionAction[]; - } - - export interface IAuthenticationContribution { -+ /** -+ * The id of the authentication provider. -+ */ - readonly id: string; -+ /** -+ * The human readable name of the authentication provider. -+ */ - readonly label: string; - } - - export interface IWalkthroughStep { -+ /** -+ * Unique identifier for this step. This is used to keep track of which steps have been completed. -+ */ - readonly id: string; -+ /** -+ * Title of step. -+ */ - readonly title: string; -- readonly description: string | undefined; -- readonly media: -- | { image: string | { dark: string; light: string; hc: string }; altText: string; markdown?: never; svg?: never } -- | { markdown: string; image?: never; svg?: never } -- | { svg: string; altText: string; markdown?: never; image?: never }; -+ /** -+ * Description of step. Supports ``preformatted``, __italic__, and **bold** text. Use markdown-style links for commands or external links: [Title](command:myext.command), [Title](command:toSide:myext.command), or [Title](https://aka.ms). Links on their own line will be rendered as buttons. -+ */ -+ readonly description?: string; -+ readonly button?: { -+ [k: string]: unknown; -+ }; -+ /** -+ * Media to show alongside this step, either an image or markdown content. -+ */ -+ readonly media: { -+ readonly path?: { -+ [k: string]: unknown; -+ }; -+ /** -+ * Path to an image - or object consisting of paths to light, dark, and hc images - relative to extension directory. Depending on context, the image will be displayed from 400px to 800px wide, with similar bounds on height. To support HIDPI displays, the image will be rendered at 1.5x scaling, for example a 900 physical pixels wide image will be displayed as 600 logical pixels wide. -+ */ -+ readonly image: string | { -+ /** -+ * Path to the image for dark themes, relative to extension directory. -+ */ -+ readonly dark: string; -+ /** -+ * Path to the image for light themes, relative to extension directory. -+ */ -+ readonly light: string; -+ /** -+ * Path to the image for hc themes, relative to extension directory. -+ */ -+ readonly hc: string; -+ /** -+ * Path to the image for hc light themes, relative to extension directory. -+ */ -+ readonly hcLight: string; -+ }; -+ /** -+ * Alternate text to display when the image cannot be loaded or in screen readers. -+ */ -+ readonly altText: string; -+ readonly markdown?: never; -+ readonly svg?: never; -+ } | { -+ /** -+ * Path to an svg, color tokens are supported in variables to support theming to match the workbench. -+ */ -+ readonly svg: string; -+ /** -+ * Alternate text to display when the image cannot be loaded or in screen readers. -+ */ -+ readonly altText: string; -+ readonly image?: never; -+ readonly markdown?: never; -+ } | { -+ readonly path?: { -+ [k: string]: unknown; -+ }; -+ /** -+ * Path to the markdown document, relative to extension directory. -+ */ -+ readonly markdown: string; -+ readonly image?: never; -+ readonly svg?: never; -+ }; -+ /** -+ * Events that should trigger this step to become checked off. If empty or not defined, the step will check off when any of the step's buttons or links are clicked; if the step has no buttons or links it will check on when it is selected. -+ */ - readonly completionEvents?: string[]; -- /** @deprecated use `completionEvents: 'onCommand:...'` */ -+ /** -+ * Signal to mark step as complete. -+ * @deprecated use `completionEvents: 'onCommand:...'` -+ **/ - readonly doneOn?: { command: string }; -+ /** -+ * Context key expression to control the visibility of this step. -+ */ - readonly when?: string; - } - - export interface IWalkthrough { -+ /** -+ * Unique identifier for this walkthrough. -+ */ - readonly id: string; -+ /** -+ * Title of walkthrough. -+ */ - readonly title: string; -+ /** -+ * Relative path to the icon of the walkthrough. The path is relative to the extension location. If not specified, the icon defaults to the extension icon if available. -+ */ - readonly icon?: string; -+ /** -+ * Description of walkthrough. -+ */ - readonly description: string; -- readonly steps: IWalkthroughStep[]; -- readonly featuredFor: string[] | undefined; -+ /** -+ * Walkthroughs that match one of these glob patterns appear as 'featured' in workspaces with the specified files. For example, a walkthrough for TypeScript projects might specify `tsconfig.json` here. -+ */ -+ readonly featuredFor?: string[]; -+ /** -+ * Context key expression to control the visibility of this walkthrough. -+ */ - readonly when?: string; -+ readonly steps: IWalkthroughStep[]; - } - - export interface IStartEntry { -@@ -139,14 +615,53 @@ export interface IStartEntry { - } - - export interface INotebookEntry { -+ /** -+ * Type of the notebook. -+ */ - readonly type: string; -+ /** -+ * Human readable name of the notebook. -+ */ - readonly displayName: string; -+ /** -+ * Set of globs that the notebook is for. -+ */ -+ readonly selector: { -+ /** -+ * Glob that the notebook is enabled for. -+ */ -+ readonly filenamePattern?: string; -+ /** -+ * Glob that the notebook is disabled for. -+ */ -+ readonly excludeFileNamePattern?: string; -+ }[]; -+ readonly priority?: 'default' | 'option'; - } - - export interface INotebookRendererContribution { -+ /** -+ * Unique identifier of the notebook output renderer. -+ */ - readonly id: string; -+ /** -+ * Human readable name of the notebook output renderer. -+ */ - readonly displayName: string; -+ readonly dependencies?: string[]; -+ readonly optionalDependencies?: string[]; -+ /** -+ * Defines how and if the renderer needs to communicate with an extension host, via `createRendererMessaging`. Renderers with stronger messaging requirements may not work in all environments. -+ */ -+ readonly requiresMessaging?: 'always' | 'optional' | 'never'; -+ /** -+ * Set of globs that the notebook is for. -+ */ - readonly mimeTypes: string[]; -+ readonly entrypoint: string | { -+ readonly extends: string; -+ readonly path: string; -+ }; - } - - export interface IDebugVisualizationContribution { -@@ -155,44 +670,884 @@ export interface IDebugVisualizationContribution { - } - - export interface ITranslation { -- id: string; -- path: string; --} -- --export interface ILocalizationContribution { -- languageId: string; -- languageName?: string; -- localizedLanguageName?: string; -- translations: ITranslation[]; -- minimalTranslations?: { [key: string]: string }; -+ /** -+ * Id of VS Code or Extension for which this translation is contributed to. Id of VS Code is always `vscode` and of extension should be in format `publisherId.extensionName`. -+ */ -+ readonly id: string; -+ /** -+ * A relative path to a file containing translations for the language. -+ */ -+ readonly path: string; -+} -+ -+export interface ILocalizationContribution { -+ /** -+ * Id of the language into which the display strings are translated. -+ */ -+ readonly languageId: string; -+ /** -+ * Name of the language in English. -+ */ -+ readonly languageName?: string; -+ /** -+ * Name of the language in contributed language. -+ */ -+ readonly localizedLanguageName?: string; -+ /** -+ * -+ */ -+ readonly translations: ITranslation[]; -+} -+ -+export interface ITerminal { -+ readonly profiles?: { -+ readonly id: string; -+ readonly title: string; -+ readonly icon?: (string | { -+ /** -+ * Icon path when a light theme is used -+ */ -+ readonly light?: string; -+ /** -+ * Icon path when a dark theme is used -+ */ -+ readonly dark?: string; -+ [k: string]: unknown; -+ }); -+ }[]; -+} -+ -+export interface IStatusBarItem { -+ readonly id: string; -+ /** -+ * The name of the entry, like 'Python Language Indicator', 'Git Status' etc. Try to keep the length of the name short, yet descriptive enough that users can understand what the status bar item is about. -+ */ -+ readonly name: string; -+ /** -+ * The text to show for the entry. You can embed icons in the text by leveraging the `$()`-syntax, like 'Hello $(globe)!' -+ */ -+ readonly text: string; -+ /** -+ * The tooltip text for the entry. -+ */ -+ readonly tooltip?: string; -+ /** -+ * The command to execute when the status bar entry is clicked. -+ */ -+ readonly command?: string; -+ /** -+ * The alignment of the status bar entry. -+ */ -+ readonly alignment: 'left' | 'right'; -+ /** -+ * The priority of the status bar entry. Higher value means the item should be shown more to the left. -+ */ -+ readonly priority?: number; -+ /** -+ * Defines the role and aria label to be used when the status bar entry is focused. -+ */ -+ readonly accessibilityInformation?: { -+ /** -+ * The role of the status bar entry which defines how a screen reader interacts with it. More about aria roles can be found here https://w3c.github.io/aria/#widget_roles -+ */ -+ readonly role?: string; -+ /** -+ * The aria label of the status bar entry. Defaults to the entry's text. -+ */ -+ readonly label?: string; -+ }; -+} -+ -+export interface IRemoteHelp { -+ /** -+ * The url, or a command that returns the url, to your project's Getting Started page, or a walkthrough ID contributed by your project's extension -+ */ -+ readonly getStarted?: string | { -+ /** -+ * The ID of a Get Started walkthrough to open. -+ */ -+ id: string; -+ }; -+ /** -+ * The url, or a command that returns the url, to your project's documentation page -+ */ -+ readonly documentation?: string; -+ /** -+ * The url, or a command that returns the url, to your project's feedback reporter -+ */ -+ readonly feedback?: string; -+ /** -+ * The url, or a command that returns the url, to your project's issue reporter -+ */ -+ readonly reportIssue?: string; -+ /** -+ * The url, or a command that returns the url, to your project's issues list -+ */ -+ readonly issues?: string; -+} -+ -+export interface ITaskDefinitions { -+ /** -+ * The actual task type. Please note that types starting with a '$' are reserved for internal usage. -+ */ -+ readonly type?: string; -+ readonly required?: string[]; -+ /** -+ * Additional properties of the task type -+ */ -+ readonly properties?: { -+ [k: string]: IJSONSchema; -+ }; -+ readonly when?: string; -+} -+ -+export interface IIcon { -+ /** -+ * The description of the themable icon -+ */ -+ readonly description: string; -+ /** -+ * The default of the icon. Either a reference to an extisting ThemeIcon or an icon in an icon font. -+ */ -+ readonly default: string | { -+ /** -+ * The path of the icon font that defines the icon. -+ */ -+ readonly fontPath: string; -+ /** -+ * The character for the icon in the icon font. -+ */ -+ readonly fontCharacter: string; -+ }; -+} -+ -+export interface IDocumentationRefactoring { -+ /** -+ * Label for the documentation used in the UI. -+ */ -+ readonly title: string; -+ /** -+ * When clause. -+ */ -+ readonly when: string; -+ /** -+ * Command executed. -+ */ -+ readonly command: string; -+} -+ -+export interface IDocumentation { -+ /** -+ * Contributed documentation for refactorings. -+ */ -+ readonly refactoring?: IDocumentationRefactoring[]; -+} -+ -+export interface ISubMenu { -+ /** -+ * Identifier of the menu to display as a submenu. -+ */ -+ readonly id: string; -+ /** -+ * The label of the menu item which leads to this submenu. -+ */ -+ readonly label: string; -+ /** -+ * (Optional) Icon which is used to represent the submenu in the UI. Either a file path, an object with file paths for dark and light themes, or a theme icon references, like `\$(zap)` -+ */ -+ readonly icon?: -+ | string -+ | { -+ /** -+ * Icon path when a light theme is used -+ */ -+ readonly light?: string; -+ /** -+ * Icon path when a dark theme is used -+ */ -+ readonly dark?: string; -+ }; -+} -+ -+interface IResourceLabelFormatters { -+ /** -+ * URI scheme on which to match the formatter on. For example "file". Simple glob patterns are supported. -+ */ -+ readonly scheme: string; -+ /** -+ * URI authority on which to match the formatter on. Simple glob patterns are supported. -+ */ -+ readonly authority?: string; -+ /** -+ * Rules for formatting uri resource labels. -+ */ -+ readonly formatting: { -+ /** -+ * Label rules to display. For example: myLabel:/${path}. ${path}, ${scheme}, ${authority} and ${authoritySuffix} are supported as variables. -+ */ -+ readonly label?: string; -+ /** -+ * Separator to be used in the uri label display. '/' or '' as an example. -+ */ -+ readonly separator?: string; -+ /** -+ * Controls whether `${path}` substitutions should have starting separator characters stripped. -+ */ -+ readonly stripPathStartingSeparator?: boolean; -+ /** -+ * Controls if the start of the uri label should be tildified when possible. -+ */ -+ readonly tildify?: boolean; -+ /** -+ * Suffix appended to the workspace label. -+ */ -+ readonly workspaceSuffix?: string; -+ }; -+} -+ -+export interface ISemanticTokenTypes { -+ /** -+ * The identifier of the semantic token type -+ */ -+ readonly id?: string; -+ /** -+ * The super type of the semantic token type -+ */ -+ readonly superType?: string; -+ /** -+ * The description of the semantic token type -+ */ -+ readonly description?: string; -+} -+ -+export interface ISemanticTokenModifiers { -+ /** -+ * The identifier of the semantic token modifier -+ */ -+ readonly id?: string; -+ /** -+ * The description of the semantic token modifier -+ */ -+ readonly description?: string; -+} -+ -+export interface ISemanticTokenScopes { -+ /** -+ * Lists the languge for which the defaults are. -+ */ -+ readonly language?: string; -+ /** -+ * Maps a semantic token (described by semantic token selector) to one or more textMate scopes used to represent that token. -+ */ -+ readonly scopes?: { -+ [k: string]: string[]; -+ }; -+} -+ -+export interface IBreakpoint { -+ /** -+ * Allow breakpoints for this language. -+ */ -+ readonly language?: string; -+ /** -+ * Condition which must be true to enable breakpoints in this language. Consider matching this to the debugger when clause as appropriate. -+ */ -+ readonly when?: string; -+} -+ -+export interface ITerminalQuickFix { -+ /** -+ * The ID of the quick fix provider -+ */ -+ readonly id: string; -+ /** -+ * A regular expression or string to test the command line against -+ */ -+ readonly commandLineMatcher: string; -+ readonly outputMatcher: { -+ /** -+ * A regular expression or string to test the command line against -+ */ -+ readonly lineMatcher: string; -+ /** -+ * Where the search should begin in the buffer -+ */ -+ readonly anchor: 'top' | 'bottom'; -+ /** -+ * The number of lines vertically from the anchor in the buffer to start matching against -+ */ -+ readonly offset: number; -+ /** -+ * The number of rows to match against, this should be as small as possible for performance reasons -+ */ -+ readonly length: number; -+ }; -+ /** -+ * The command exit result to match on -+ */ -+ readonly commandExitResult: 'success' | 'error'; -+ /** -+ * The kind of the resulting quick fix. This changes how the quick fix is presented. Defaults to `"fix"`. -+ */ -+ readonly kind?: 'default' | 'explain'; -+} -+ -+export interface IInteractiveSession { -+ /** -+ * Unique identifier for this Interactive Session provider. -+ */ -+ readonly id: string; -+ /** -+ * Display name for this Interactive Session provider. -+ */ -+ readonly label: string; -+ /** -+ * An icon for this Interactive Session provider. -+ */ -+ readonly icon?: string; -+ /** -+ * A condition which must be true to enable this Interactive Session provider. -+ */ -+ readonly when?: string; -+} -+ -+export interface INotebook { -+ /** -+ * Type of the notebook. -+ */ -+ readonly type: string; -+ /** -+ * Human readable name of the notebook. -+ */ -+ readonly displayName: string; -+ /** -+ * Set of globs that the notebook is for. -+ */ -+ readonly selector: { -+ /** -+ * Glob that the notebook is enabled for. -+ */ -+ readonly filenamePattern?: string; -+ /** -+ * Glob that the notebook is disabled for. -+ */ -+ readonly excludeFileNamePattern?: string; -+ }[]; -+ readonly priority?: 'default' | 'option'; -+} -+ -+export interface NotebookPreload { -+ /** -+ * Type of the notebook. -+ */ -+ readonly type: string; -+ /** -+ * Path to file loaded in the webview. -+ */ -+ readonly entrypoint: string; -+ /** -+ * Paths to additional resources that should be allowed in the webview. -+ */ -+ readonly localResourceRoots?: string[]; -+} -+ -+export interface IViewsWelcome { -+ readonly view: string; -+ /** -+ * Welcome content to be displayed. The format of the contents is a subset of Markdown, with support for links only. -+ */ -+ readonly contents: string; -+ /** -+ * Condition when the welcome content should be displayed. -+ */ -+ readonly when?: string; -+ /** -+ * Group to which this welcome content belongs. Proposed API. -+ */ -+ readonly group?: string; -+ /** -+ * Condition when the welcome content buttons and command links should be enabled. -+ */ -+ readonly enablement?: string; -+} -+ -+ -+export interface INamedProblemPattern extends IProblemPattern { -+ /** -+ * The name of the problem pattern. -+ */ -+ name: string; -+ -+ /** -+ * A human readable label -+ */ -+ label?: string; -+} -+ -+export interface ICheckedProblemPattern extends IProblemPattern { -+ /** -+ * The regular expression to find a problem in the console output of an -+ * executed task. -+ */ -+ regexp: string; -+} -+ -+export type MultiLineCheckedProblemPattern = ICheckedProblemPattern[]; -+ -+export interface INamedMultiLineCheckedProblemPattern { -+ /** -+ * The name of the problem pattern. -+ */ -+ name: string; -+ -+ /** -+ * A human readable label -+ */ -+ label?: string; -+ -+ /** -+ * The actual patterns -+ */ -+ patterns: MultiLineCheckedProblemPattern; -+} -+ -+export type NamedProblemPatterns = (INamedProblemPattern | INamedMultiLineCheckedProblemPattern)[]; -+ -+export interface IProblemPattern { -+ -+ /** -+ * The regular expression to find a problem in the console output of an -+ * executed task. -+ */ -+ regexp?: string; -+ -+ /** -+ * Whether the pattern matches a whole file, or a location (file/line) -+ * -+ * The default is to match for a location. Only valid on the -+ * first problem pattern in a multi line problem matcher. -+ */ -+ kind?: string; -+ -+ /** -+ * The match group index of the filename. -+ * If omitted 1 is used. -+ */ -+ file?: number; -+ -+ /** -+ * The match group index of the problem's location. Valid location -+ * patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn). -+ * If omitted the line and column properties are used. -+ */ -+ location?: number; -+ -+ /** -+ * The match group index of the problem's line in the source file. -+ * -+ * Defaults to 2. -+ */ -+ line?: number; -+ -+ /** -+ * The match group index of the problem's column in the source file. -+ * -+ * Defaults to 3. -+ */ -+ column?: number; -+ -+ /** -+ * The match group index of the problem's end line in the source file. -+ * -+ * Defaults to undefined. No end line is captured. -+ */ -+ endLine?: number; -+ -+ /** -+ * The match group index of the problem's end column in the source file. -+ * -+ * Defaults to undefined. No end column is captured. -+ */ -+ endColumn?: number; -+ -+ /** -+ * The match group index of the problem's severity. -+ * -+ * Defaults to undefined. In this case the problem matcher's severity -+ * is used. -+ */ -+ severity?: number; -+ -+ /** -+ * The match group index of the problem's code. -+ * -+ * Defaults to undefined. No code is captured. -+ */ -+ code?: number; -+ -+ /** -+ * The match group index of the message. If omitted it defaults -+ * to 4 if location is specified. Otherwise it defaults to 5. -+ */ -+ message?: number; -+ -+ /** -+ * Specifies if the last pattern in a multi line problem matcher should -+ * loop as long as it does match a line consequently. Only valid on the -+ * last problem pattern in a multi line problem matcher. -+ */ -+ loop?: boolean; -+} -+ -+/** -+* A watching pattern -+*/ -+export interface IWatchingPattern { -+ /** -+ * The actual regular expression -+ */ -+ regexp?: string; -+ -+ /** -+ * The match group index of the filename. If provided the expression -+ * is matched for that file only. -+ */ -+ file?: number; -+} -+ -+/** -+* A description to track the start and end of a watching task. -+*/ -+export interface IBackgroundMonitor { -+ -+ /** -+ * If set to true the watcher is in active mode when the task -+ * starts. This is equals of issuing a line that matches the -+ * beginsPattern. -+ */ -+ activeOnStart?: boolean; -+ -+ /** -+ * If matched in the output the start of a watching task is signaled. -+ */ -+ beginsPattern?: string | IWatchingPattern; -+ -+ /** -+ * If matched in the output the end of a watching task is signaled. -+ */ -+ endsPattern?: string | IWatchingPattern; -+} -+ -+export interface INamedProblemMatcher { -+ /** -+ * This name can be used to refer to the -+ * problem matcher from within a task. -+ */ -+ name: string; -+ -+ /** -+ * A human readable label. -+ */ -+ label?: string; -+ -+ /** -+ * The name of a base problem matcher to use. If specified the -+ * base problem matcher will be used as a template and properties -+ * specified here will replace properties of the base problem -+ * matcher -+ */ -+ base?: string; -+ -+ /** -+ * The owner of the produced VSCode problem. This is typically -+ * the identifier of a VSCode language service if the problems are -+ * to be merged with the one produced by the language service -+ * or a generated internal id. Defaults to the generated internal id. -+ */ -+ owner?: string; -+ -+ /** -+ * A human-readable string describing the source of this problem. -+ * E.g. 'typescript' or 'super lint'. -+ */ -+ source?: string; -+ -+ /** -+ * Specifies to which kind of documents the problems found by this -+ * matcher are applied. Valid values are: -+ * -+ * "allDocuments": problems found in all documents are applied. -+ * "openDocuments": problems found in documents that are open -+ * are applied. -+ * "closedDocuments": problems found in closed documents are -+ * applied. -+ */ -+ applyTo?: string; -+ -+ /** -+ * The severity of the VSCode problem produced by this problem matcher. -+ * -+ * Valid values are: -+ * "error": to produce errors. -+ * "warning": to produce warnings. -+ * "info": to produce infos. -+ * -+ * The value is used if a pattern doesn't specify a severity match group. -+ * Defaults to "error" if omitted. -+ */ -+ severity?: string; -+ -+ /** -+ * Defines how filename reported in a problem pattern -+ * should be read. Valid values are: -+ * - "absolute": the filename is always treated absolute. -+ * - "relative": the filename is always treated relative to -+ * the current working directory. This is the default. -+ * - ["relative", "path value"]: the filename is always -+ * treated relative to the given path value. -+ * - "autodetect": the filename is treated relative to -+ * the current workspace directory, and if the file -+ * does not exist, it is treated as absolute. -+ * - ["autodetect", "path value"]: the filename is treated -+ * relative to the given path value, and if it does not -+ * exist, it is treated as absolute. -+ * - ["search", { include?: "" | []; exclude?: "" | [] }]: The filename -+ * needs to be searched under the directories named by the "include" -+ * property and their nested subdirectories. With "exclude" property -+ * present, the directories should be removed from the search. When -+ * `include` is not unprovided, the current workspace directory should -+ * be used as the default. -+ */ -+ fileLocation?: string | string[] | ['search', ISearchFileLocationArgs]; -+ -+ /** -+ * The name of a predefined problem pattern, the inline definition -+ * of a problem pattern or an array of problem patterns to match -+ * problems spread over multiple lines. -+ */ -+ pattern?: string | IProblemPattern | IProblemPattern[]; -+ -+ /** -+ * A regular expression signaling that a watched tasks begins executing -+ * triggered through file watching. -+ */ -+ watchedTaskBeginsRegExp?: string; -+ -+ /** -+ * A regular expression signaling that a watched tasks ends executing. -+ */ -+ watchedTaskEndsRegExp?: string; -+ -+ /** -+ * @deprecated Use background instead. -+ */ -+ watching?: IBackgroundMonitor; -+ background?: IBackgroundMonitor; -+} -+ -+export type ISearchFileLocationArgs = { -+ include?: string | string[]; -+ exclude?: string | string[]; -+}; -+ -+export interface ITypescriptServerPlugin { -+ /** -+ * Name of the plugin as listed in the package.json. -+ */ -+ name: string; -+ /** -+ * Should the plugin be loaded when using workspace versions of TypeScript? -+ */ -+ enableForWorkspaceTypeScriptVersions: boolean; -+} -+ -+export interface IHtmlLanguageParticipant { -+ /** -+ * The id of the language that participates with HTML language server. -+ */ -+ languageId: string; -+ /** -+ * Whether the language participates with HTML auto insertions. If not specified, defaults to true. -+ */ -+ autoInsert: boolean; - } - - export interface IExtensionContributions { -- commands?: ICommand[]; -- configuration?: any; -- debuggers?: IDebugger[]; -- grammars?: IGrammar[]; -- jsonValidation?: IJSONValidation[]; -- keybindings?: IKeyBinding[]; -- languages?: ILanguage[]; -- menus?: { [context: string]: IMenu[] }; -- snippets?: ISnippet[]; -- themes?: ITheme[]; -- iconThemes?: ITheme[]; -- productIconThemes?: ITheme[]; -- viewsContainers?: { [location: string]: IViewContainer[] }; -- views?: { [location: string]: IView[] }; -- colors?: IColor[]; -- localizations?: ILocalizationContribution[]; -+ /** -+ * Contributes terminal functionality. -+ */ -+ readonly terminal?: ITerminal; -+ /** -+ * Contributes commands to the command palette. -+ */ -+ readonly commands?: ICommand[]; -+ /** -+ * Contributes configuration settings. -+ */ -+ readonly configuration?: any; -+ /** -+ * Contributes debug adapters. -+ */ -+ readonly debuggers?: IDebugger[]; -+ /** -+ * Contributes breakpoints. -+ */ -+ readonly breakpoints?: IBreakpoint[]; -+ /** -+ * Contributes textmate tokenizers. -+ */ -+ readonly grammars?: IGrammar[]; -+ /** -+ * Contributes json schema configuration. -+ */ -+ readonly jsonValidation?: IJSONValidation[]; -+ /** -+ * Contributes keybindings. -+ */ -+ readonly keybindings?: IKeyBinding[]; -+ /** -+ * Contributes language declarations. -+ */ -+ readonly languages?: ILanguage[]; -+ /** -+ * Contributes menu items to the editor -+ */ -+ readonly menus?: { [context: string]: IMenu[] }; -+ /** -+ * Contributes submenu items to the editor -+ */ -+ readonly submenus?: ISubMenu[]; -+ /** -+ * Contributes snippets. -+ */ -+ readonly snippets?: ISnippet[]; -+ /** -+ * Contributes textmate color themes. -+ */ -+ readonly themes?: IColorTheme[]; -+ /** -+ * Contributes file icon themes. -+ */ -+ readonly iconThemes?: IIconTheme[]; -+ /** -+ * Contributes product icon themes. -+ */ -+ readonly productIconThemes?: IProductTheme[]; -+ /** -+ * Contributes views containers to the editor -+ */ -+ readonly viewsContainers?: { [location: string]: IViewContainer[] }; -+ /** -+ * Contributes views to the editor -+ */ -+ readonly views?: { [location: string]: IView[] }; -+ /** -+ * Contributes extension defined themable colors -+ */ -+ readonly colors?: IColor[]; -+ /** -+ * Contributes localizations to the editor -+ */ -+ readonly localizations?: ILocalizationContribution[]; -+ /** -+ * Contributed custom editors. -+ */ - readonly customEditors?: readonly IWebviewEditor[]; - readonly codeActions?: readonly ICodeActionContribution[]; -- authentication?: IAuthenticationContribution[]; -- walkthroughs?: IWalkthrough[]; -- startEntries?: IStartEntry[]; -+ /** -+ * Contributes authentication -+ */ -+ readonly authentication?: IAuthenticationContribution[]; -+ /** -+ * Contribute walkthroughs to help users getting started with your extension. -+ */ -+ readonly walkthroughs?: IWalkthrough[]; -+ readonly startEntries?: IStartEntry[]; -+ /** -+ * Contributes notebook document provider. -+ */ - readonly notebooks?: INotebookEntry[]; -+ /** -+ * Contributes notebook output renderer provider. -+ */ - readonly notebookRenderer?: INotebookRendererContribution[]; - readonly debugVisualizers?: IDebugVisualizationContribution[]; - readonly chatParticipants?: ReadonlyArray<{ id: string }>; -+ /** -+ * Contributes notebook preloads. -+ */ -+ readonly notebookPreload?: NotebookPreload[]; -+ /** -+ * Contributes items to the status bar. -+ */ -+ readonly statusBarItems?: IStatusBarItem[]; -+ /** -+ * Contributes help information for Remote -+ */ -+ readonly remoteHelp?: IRemoteHelp; -+ /** -+ * Contributes task kinds -+ */ -+ readonly taskDefinitions?: ITaskDefinitions[]; -+ /** -+ * Contributes extension defined themable icons -+ */ -+ readonly icons?: { [id: string]: IIcon }; -+ /** -+ * Contributed documentation. -+ */ -+ readonly documentation?: IDocumentation; -+ /** -+ * Contributes resource label formatting rules. -+ */ -+ readonly resourceLabelFormatters?: IResourceLabelFormatters[]; -+ readonly configurationDefaults?: { [id: string]: any }; -+ /** -+ * Contributes semantic token types. -+ */ -+ readonly semanticTokenTypes?: ISemanticTokenTypes[]; -+ /** -+ * Contributes semantic token modifiers. -+ */ -+ readonly semanticTokenModifiers?: ISemanticTokenModifiers[]; -+ /** -+ * Contributes semantic token scope maps. -+ */ -+ readonly semanticTokenScopes?: ISemanticTokenScopes[]; -+ /** -+ * Contributes terminal quick fixes. -+ */ -+ readonly terminalQuickFixes?: ITerminalQuickFix[]; -+ /** -+ * Contributes an Interactive Session provider -+ */ -+ readonly interactiveSession?: IInteractiveSession[]; -+ /** -+ * Contributed views welcome content. Welcome content will be rendered in tree based views whenever they have no meaningful content to display, ie. the File Explorer when no folder is open. Such content is useful as in-product documentation to drive users to use certain features before they are available. A good example would be a `Clone Repository` button in the File Explorer welcome view. -+ */ -+ readonly viewsWelcome?: IViewsWelcome[]; -+ /** -+ * Contributes problem matchers -+ */ -+ readonly problemMatchers?: INamedProblemMatcher[]; -+ /** -+ * Contributes problem patterns -+ */ -+ readonly problemPatterns?: NamedProblemPatterns; -+ /** -+ * Contributed TypeScript server plugins. -+ */ -+ readonly typescriptServerPlugins?: ITypescriptServerPlugin[]; -+ /** -+ * A list of languages that participate with the HTML language server. -+ */ -+ readonly htmlLanguageParticipants?: IHtmlLanguageParticipant[]; -+ readonly html?: { -+ customData?: string[]; -+ }; -+ readonly css?: { -+ customData?: string[]; -+ }; - } - - export interface IExtensionCapabilities { -diff --git a/src/vs/workbench/services/search/common/queryBuilder.ts b/src/vs/workbench/services/search/common/queryBuilder.ts -index 4b712c6be50..2d68500db7a 100644 ---- a/src/vs/workbench/services/search/common/queryBuilder.ts -+++ b/src/vs/workbench/services/search/common/queryBuilder.ts -@@ -613,10 +613,10 @@ export class QueryBuilder { - folderName: includeFolderName ? folderName : undefined, - excludePattern: excludePatternRet, - fileEncoding: folderConfig.files && folderConfig.files.encoding, -- disregardIgnoreFiles: typeof options.disregardIgnoreFiles === 'boolean' ? options.disregardIgnoreFiles : !folderConfig.search.useIgnoreFiles, -- disregardGlobalIgnoreFiles: typeof options.disregardGlobalIgnoreFiles === 'boolean' ? options.disregardGlobalIgnoreFiles : !folderConfig.search.useGlobalIgnoreFiles, -- disregardParentIgnoreFiles: typeof options.disregardParentIgnoreFiles === 'boolean' ? options.disregardParentIgnoreFiles : !folderConfig.search.useParentIgnoreFiles, -- ignoreSymlinks: typeof options.ignoreSymlinks === 'boolean' ? options.ignoreSymlinks : !folderConfig.search.followSymlinks, -+ disregardIgnoreFiles: typeof options.disregardIgnoreFiles === 'boolean' ? options.disregardIgnoreFiles : !folderConfig.search?.useIgnoreFiles, -+ disregardGlobalIgnoreFiles: typeof options.disregardGlobalIgnoreFiles === 'boolean' ? options.disregardGlobalIgnoreFiles : !folderConfig.search?.useGlobalIgnoreFiles, -+ disregardParentIgnoreFiles: typeof options.disregardParentIgnoreFiles === 'boolean' ? options.disregardParentIgnoreFiles : !folderConfig.search?.useParentIgnoreFiles, -+ ignoreSymlinks: typeof options.ignoreSymlinks === 'boolean' ? options.ignoreSymlinks : !folderConfig.search?.followSymlinks, - }; - } - } -diff --git a/src/vs/workbench/services/themes/common/colorExtensionPoint.ts b/src/vs/workbench/services/themes/common/colorExtensionPoint.ts -index 889c61bb08c..b392cc8614f 100644 ---- a/src/vs/workbench/services/themes/common/colorExtensionPoint.ts -+++ b/src/vs/workbench/services/themes/common/colorExtensionPoint.ts -@@ -186,7 +186,7 @@ class ColorDataRenderer extends Disposable implements IExtensionFeatureTableRend - color.description, - toColor(color.defaults.dark) ?? new MarkdownString().appendMarkdown(`\`${color.defaults.dark}\``), - toColor(color.defaults.light) ?? new MarkdownString().appendMarkdown(`\`${color.defaults.light}\``), -- toColor(color.defaults.highContrast) ?? new MarkdownString().appendMarkdown(`\`${color.defaults.highContrast}\``), -+ toColor(color.defaults.highContrast!) ?? new MarkdownString().appendMarkdown(`\`${color.defaults.highContrast}\``), - ]; - }); - -diff --git a/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts b/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts -index e10bf30175f..d78e65afc3f 100644 ---- a/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts -+++ b/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts -@@ -69,6 +69,7 @@ const tokenModifierExtPoint = ExtensionsRegistry.registerExtensionPoint -Date: Mon, 11 Mar 2024 17:41:13 +0100 -Subject: [PATCH] fix: fix dependency injection - ---- - src/vs/platform/instantiation/common/instantiationService.ts | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/vs/platform/instantiation/common/instantiationService.ts b/src/vs/platform/instantiation/common/instantiationService.ts -index 86099cc8b66..64c25039c0f 100644 ---- a/src/vs/platform/instantiation/common/instantiationService.ts -+++ b/src/vs/platform/instantiation/common/instantiationService.ts -@@ -245,8 +245,10 @@ export class InstantiationService implements IInstantiationService { - - if (instanceOrDesc instanceof SyncDescriptor) { - const d = { id: dependency.id, desc: instanceOrDesc, _trace: item._trace.branch(dependency.id, true) }; -+ if (!graph.lookup(d)) { -+ stack.push(d); -+ } - graph.insertEdge(item, d); -- stack.push(d); - } - } - } diff --git a/vscode-paches/0019-fix-only-run-some-code-if-inside-the-worker.patch b/vscode-paches/0019-fix-only-run-some-code-if-inside-the-worker.patch deleted file mode 100644 index 6e9cd665..00000000 --- a/vscode-paches/0019-fix-only-run-some-code-if-inside-the-worker.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:42:28 +0100 -Subject: [PATCH] fix: only run some code if inside the worker - ---- - .../workbench/api/common/extHostExtensionService.ts | 10 ++++++---- - src/vs/workbench/api/common/extensionHostMain.ts | 11 ++++++++--- - .../workbench/api/worker/extHostExtensionService.ts | 7 +++++-- - 3 files changed, 19 insertions(+), 9 deletions(-) - -diff --git a/src/vs/workbench/api/common/extHostExtensionService.ts b/src/vs/workbench/api/common/extHostExtensionService.ts -index e6af1f781be..07017a784d4 100644 ---- a/src/vs/workbench/api/common/extHostExtensionService.ts -+++ b/src/vs/workbench/api/common/extHostExtensionService.ts -@@ -45,7 +45,7 @@ import { Schemas } from '../../../base/common/network.js'; - import { IResolveAuthorityResult } from '../../services/extensions/common/extensionHostProxy.js'; - import { IExtHostLocalizationService } from './extHostLocalizationService.js'; - import { StopWatch } from '../../../base/common/stopwatch.js'; --import { isCI, setTimeout0 } from '../../../base/common/platform.js'; -+import { isCI, isWebWorker, setTimeout0 } from '../../../base/common/platform.js'; - import { IExtHostManagedSockets } from './extHostManagedSockets.js'; - import { Dto } from '../../services/extensions/common/proxyIdentifier.js'; - -@@ -259,9 +259,11 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme - this._extHostTerminalService.dispose(); - this._activator.dispose(); - -- errors.setUnexpectedErrorHandler((err) => { -- this._logService.error(err); -- }); -+ if (isWebWorker) { -+ errors.setUnexpectedErrorHandler((err) => { -+ this._logService.error(err); -+ }); -+ } - - // Invalidate all proxies - this._extHostContext.dispose(); -diff --git a/src/vs/workbench/api/common/extensionHostMain.ts b/src/vs/workbench/api/common/extensionHostMain.ts -index 065479ba269..3089e188325 100644 ---- a/src/vs/workbench/api/common/extensionHostMain.ts -+++ b/src/vs/workbench/api/common/extensionHostMain.ts -@@ -23,6 +23,7 @@ import { IURITransformerService, URITransformerService } from './extHostUriTrans - import { IExtHostExtensionService, IHostUtils } from './extHostExtensionService.js'; - import { IExtHostTelemetry } from './extHostTelemetry.js'; - import { Mutable } from '../../../base/common/types.js'; -+import { isWebWorker } from '../../../base/common/platform.js'; - - export interface IExitFn { - (code?: number): any; -@@ -161,7 +162,9 @@ export class ExtensionHostMain { - - const instaService: IInstantiationService = new InstantiationService(services, true); - -- instaService.invokeFunction(ErrorHandler.installEarlyHandler); -+ if (isWebWorker) { -+ instaService.invokeFunction(ErrorHandler.installEarlyHandler); -+ } - - // ugly self - inject - this._logService = instaService.invokeFunction(accessor => accessor.get(ILogService)); -@@ -180,8 +183,10 @@ export class ExtensionHostMain { - this._extensionService = instaService.invokeFunction(accessor => accessor.get(IExtHostExtensionService)); - this._extensionService.initialize(); - -- // install error handler that is extension-aware -- instaService.invokeFunction(ErrorHandler.installFullHandler); -+ if (isWebWorker) { -+ // install error handler that is extension-aware -+ instaService.invokeFunction(ErrorHandler.installFullHandler); -+ } - } - - async asBrowserUri(uri: URI): Promise { -diff --git a/src/vs/workbench/api/worker/extHostExtensionService.ts b/src/vs/workbench/api/worker/extHostExtensionService.ts -index 6f3384ab89c..71c42330bd1 100644 ---- a/src/vs/workbench/api/worker/extHostExtensionService.ts -+++ b/src/vs/workbench/api/worker/extHostExtensionService.ts -@@ -12,6 +12,7 @@ import { IExtensionDescription } from '../../../platform/extensions/common/exten - import { ExtensionRuntime } from '../common/extHostTypes.js'; - import { timeout } from '../../../base/common/async.js'; - import { ExtHostConsoleForwarder } from './extHostConsoleForwarder.js'; -+import { isWebWorker } from '../../../base/common/platform.js'; - - class WorkerRequireInterceptor extends RequireInterceptor { - -@@ -39,8 +40,10 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService { - private _fakeModules?: WorkerRequireInterceptor; - - protected async _beforeAlmostReadyToRunExtensions(): Promise { -- // make sure console.log calls make it to the render -- this._instaService.createInstance(ExtHostConsoleForwarder); -+ if (isWebWorker) { -+ // make sure console.log calls make it to the render -+ this._instaService.createInstance(ExtHostConsoleForwarder); -+ } - - // initialize API and register actors - const apiFactory = this._instaService.invokeFunction(createApiFactoryAndRegisterActors); diff --git a/vscode-paches/0020-fix-override-log-services-even-in-main-thread.patch b/vscode-paches/0020-fix-override-log-services-even-in-main-thread.patch deleted file mode 100644 index 330a7571..00000000 --- a/vscode-paches/0020-fix-override-log-services-even-in-main-thread.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:46:45 +0100 -Subject: [PATCH] fix: override log services even in main thread - ---- - src/vs/workbench/api/common/extensionHostMain.ts | 7 ++++++- - src/vs/workbench/api/worker/extHost.worker.services.ts | 4 ---- - 2 files changed, 6 insertions(+), 5 deletions(-) - -diff --git a/src/vs/workbench/api/common/extensionHostMain.ts b/src/vs/workbench/api/common/extensionHostMain.ts -index 3089e188325..41fa0fa3ca9 100644 ---- a/src/vs/workbench/api/common/extensionHostMain.ts -+++ b/src/vs/workbench/api/common/extensionHostMain.ts -@@ -12,7 +12,7 @@ import { MainContext, MainThreadConsoleShape } from './extHost.protocol.js'; - import { IExtensionHostInitData } from '../../services/extensions/common/extensionHostProtocol.js'; - import { RPCProtocol } from '../../services/extensions/common/rpcProtocol.js'; - import { ExtensionIdentifier, IExtensionDescription } from '../../../platform/extensions/common/extensions.js'; --import { ILogService } from '../../../platform/log/common/log.js'; -+import { ILoggerService, ILogService } from '../../../platform/log/common/log.js'; - import { getSingletonServiceDescriptors } from '../../../platform/instantiation/common/extensions.js'; - import { ServiceCollection } from '../../../platform/instantiation/common/serviceCollection.js'; - import { IExtHostInitDataService } from './extHostInitDataService.js'; -@@ -24,6 +24,9 @@ import { IExtHostExtensionService, IHostUtils } from './extHostExtensionService. - import { IExtHostTelemetry } from './extHostTelemetry.js'; - import { Mutable } from '../../../base/common/types.js'; - import { isWebWorker } from '../../../base/common/platform.js'; -+import { SyncDescriptor } from '../../../platform/instantiation/common/descriptors.js'; -+import { ExtHostLoggerService } from './extHostLoggerService.js'; -+import { ExtHostLogService } from './extHostLogService.js'; - - export interface IExitFn { - (code?: number): any; -@@ -159,6 +162,8 @@ export class ExtensionHostMain { - services.set(IExtHostRpcService, new ExtHostRpcService(this._rpcProtocol)); - services.set(IURITransformerService, new URITransformerService(uriTransformer)); - services.set(IHostUtils, hostUtils); -+ services.set(ILogService, new SyncDescriptor(ExtHostLogService, [true], true)); -+ services.set(ILoggerService, new SyncDescriptor(ExtHostLoggerService, [], true)); - - const instaService: IInstantiationService = new InstantiationService(services, true); - -diff --git a/src/vs/workbench/api/worker/extHost.worker.services.ts b/src/vs/workbench/api/worker/extHost.worker.services.ts -index 85c1a96bb94..229b893ea31 100644 ---- a/src/vs/workbench/api/worker/extHost.worker.services.ts -+++ b/src/vs/workbench/api/worker/extHost.worker.services.ts -@@ -3,11 +3,8 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - --import { SyncDescriptor } from '../../../platform/instantiation/common/descriptors.js'; - import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; --import { ILogService } from '../../../platform/log/common/log.js'; - import { IExtHostExtensionService } from '../common/extHostExtensionService.js'; --import { ExtHostLogService } from '../common/extHostLogService.js'; - import { ExtensionStoragePaths, IExtensionStoragePaths } from '../common/extHostStoragePaths.js'; - import { ExtHostExtensionService } from './extHostExtensionService.js'; - -@@ -17,6 +14,5 @@ import { ExtHostExtensionService } from './extHostExtensionService.js'; - // ### ### - // ######################################################################### - --registerSingleton(ILogService, new SyncDescriptor(ExtHostLogService, [true], true)); - registerSingleton(IExtHostExtensionService, ExtHostExtensionService, InstantiationType.Eager); - registerSingleton(IExtensionStoragePaths, ExtensionStoragePaths, InstantiationType.Eager); diff --git a/vscode-paches/0021-feat-expose-extHostExtensionService.patch b/vscode-paches/0021-feat-expose-extHostExtensionService.patch deleted file mode 100644 index 12586f19..00000000 --- a/vscode-paches/0021-feat-expose-extHostExtensionService.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:47:22 +0100 -Subject: [PATCH] feat: expose extHostExtensionService - ---- - src/vs/workbench/api/common/extensionHostMain.ts | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/vs/workbench/api/common/extensionHostMain.ts b/src/vs/workbench/api/common/extensionHostMain.ts -index 41fa0fa3ca9..72f8b35a069 100644 ---- a/src/vs/workbench/api/common/extensionHostMain.ts -+++ b/src/vs/workbench/api/common/extensionHostMain.ts -@@ -208,6 +208,10 @@ export class ExtensionHostMain { - this._extensionService.terminate(reason); - } - -+ getExtHostExtensionService(): IExtHostExtensionService { -+ return this._extensionService; -+ } -+ - private static _transform(initData: IExtensionHostInitData, rpcProtocol: RPCProtocol): IExtensionHostInitData { - initData.extensions.allExtensions.forEach((ext) => { - (>ext).extensionLocation = URI.revive(rpcProtocol.transformIncomingURIs(ext.extensionLocation)); diff --git a/vscode-paches/0023-feat-expose-api-factory.patch b/vscode-paches/0023-feat-expose-api-factory.patch deleted file mode 100644 index 991be7d7..00000000 --- a/vscode-paches/0023-feat-expose-api-factory.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:49:14 +0100 -Subject: [PATCH] feat: expose api factory - ---- - src/vs/workbench/api/worker/extHostExtensionService.ts | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/src/vs/workbench/api/worker/extHostExtensionService.ts b/src/vs/workbench/api/worker/extHostExtensionService.ts -index 71c42330bd1..093049532e8 100644 ---- a/src/vs/workbench/api/worker/extHostExtensionService.ts -+++ b/src/vs/workbench/api/worker/extHostExtensionService.ts -@@ -3,7 +3,7 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - --import { createApiFactoryAndRegisterActors } from '../common/extHost.api.impl.js'; -+import { createApiFactoryAndRegisterActors, IExtensionApiFactory } from '../common/extHost.api.impl.js'; - import { ExtensionActivationTimesBuilder } from '../common/extHostExtensionActivator.js'; - import { AbstractExtHostExtensionService } from '../common/extHostExtensionService.js'; - import { URI } from '../../../base/common/uri.js'; -@@ -38,6 +38,7 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService { - readonly extensionRuntime = ExtensionRuntime.Webworker; - - private _fakeModules?: WorkerRequireInterceptor; -+ protected _apiFactory?: IExtensionApiFactory; - - protected async _beforeAlmostReadyToRunExtensions(): Promise { - if (isWebWorker) { -@@ -46,8 +47,8 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService { - } - - // initialize API and register actors -- const apiFactory = this._instaService.invokeFunction(createApiFactoryAndRegisterActors); -- this._fakeModules = this._instaService.createInstance(WorkerRequireInterceptor, apiFactory, { mine: this._myRegistry, all: this._globalRegistry }); -+ this._apiFactory = this._instaService.invokeFunction(createApiFactoryAndRegisterActors); -+ this._fakeModules = this._instaService.createInstance(WorkerRequireInterceptor, this._apiFactory, { mine: this._myRegistry, all: this._globalRegistry }); - await this._fakeModules.install(); - performance.mark('code/extHost/didInitAPI'); - diff --git a/vscode-paches/0024-refactor-split-some-modules-to-be-able-to-import-the.patch b/vscode-paches/0024-refactor-split-some-modules-to-be-able-to-import-the.patch deleted file mode 100644 index 153f597c..00000000 --- a/vscode-paches/0024-refactor-split-some-modules-to-be-able-to-import-the.patch +++ /dev/null @@ -1,1951 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:49:55 +0100 -Subject: [PATCH] refactor: split some modules to be able to import them - partially - ---- - .../editor/editor.contribution._autosave.ts | 9 + - .../parts/editor/editor.contribution.ts | 3 +- - .../files/browser/fileCommands._save.ts | 225 ++++++ - .../contrib/files/browser/fileCommands.ts | 220 +----- - .../files.contribution._configuration.ts | 297 ++++++++ - .../browser/files.contribution._editorPane.ts | 93 +++ - .../browser/files.contribution._explorer.ts | 280 ++++++++ - .../files.contribution._fileEditorFactory.ts | 23 + - .../files/browser/files.contribution.ts | 659 +----------------- - 9 files changed, 939 insertions(+), 870 deletions(-) - create mode 100644 src/vs/workbench/browser/parts/editor/editor.contribution._autosave.ts - create mode 100644 src/vs/workbench/contrib/files/browser/fileCommands._save.ts - create mode 100644 src/vs/workbench/contrib/files/browser/files.contribution._configuration.ts - create mode 100644 src/vs/workbench/contrib/files/browser/files.contribution._editorPane.ts - create mode 100644 src/vs/workbench/contrib/files/browser/files.contribution._explorer.ts - create mode 100644 src/vs/workbench/contrib/files/browser/files.contribution._fileEditorFactory.ts - -diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution._autosave.ts b/src/vs/workbench/browser/parts/editor/editor.contribution._autosave.ts -new file mode 100644 -index 00000000000..c7416d68719 ---- /dev/null -+++ b/src/vs/workbench/browser/parts/editor/editor.contribution._autosave.ts -@@ -0,0 +1,9 @@ -+/*--------------------------------------------------------------------------------------------- -+ * Copyright (c) Microsoft Corporation. All rights reserved. -+ * Licensed under the MIT License. See License.txt in the project root for license information. -+ *--------------------------------------------------------------------------------------------*/ -+ -+import { EditorAutoSave } from 'vs/workbench/browser/parts/editor/editorAutoSave'; -+import { WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; -+ -+registerWorkbenchContribution2(EditorAutoSave.ID, EditorAutoSave, WorkbenchPhase.BlockRestore); -diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts -index 1c777faacaf..6977ff73214 100644 ---- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts -+++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts -@@ -61,7 +61,6 @@ import { isMacintosh } from '../../../../base/common/platform.js'; - import { EditorContributionInstantiation, registerEditorContribution } from '../../../../editor/browser/editorExtensions.js'; - import { FloatingEditorClickMenu } from '../../codeeditor.js'; - import { WorkbenchPhase, registerWorkbenchContribution2 } from '../../../common/contributions.js'; --import { EditorAutoSave } from './editorAutoSave.js'; - import { IQuickAccessRegistry, Extensions as QuickAccessExtensions } from '../../../../platform/quickinput/common/quickAccess.js'; - import { ActiveGroupEditorsByMostRecentlyUsedQuickAccess, AllEditorsByAppearanceQuickAccess, AllEditorsByMostRecentlyUsedQuickAccess } from './editorQuickAccess.js'; - import { FileAccess } from '../../../../base/common/network.js'; -@@ -72,6 +71,7 @@ import { DynamicEditorConfigurations } from './editorConfiguration.js'; - import { ConfigureEditorAction, ConfigureEditorTabsAction, EditorActionsDefaultAction, EditorActionsTitleBarAction, HideEditorActionsAction, HideEditorTabsAction, ShowMultipleEditorTabsAction, ShowSingleEditorTabAction, ZenHideEditorTabsAction, ZenShowMultipleEditorTabsAction, ZenShowSingleEditorTabAction } from '../../actions/layoutActions.js'; - import { ICommandAction } from '../../../../platform/action/common/action.js'; - import { EditorContextKeys } from '../../../../editor/common/editorContextKeys.js'; -+import './editor.contribution._autosave.js'; - - //#region Editor Registrations - -@@ -128,7 +128,6 @@ Registry.as(EditorExtensions.EditorFactory).registerEdit - - //#region Workbench Contributions - --registerWorkbenchContribution2(EditorAutoSave.ID, EditorAutoSave, WorkbenchPhase.BlockRestore); - registerWorkbenchContribution2(EditorStatusContribution.ID, EditorStatusContribution, WorkbenchPhase.BlockRestore); - registerWorkbenchContribution2(UntitledTextEditorWorkingCopyEditorHandler.ID, UntitledTextEditorWorkingCopyEditorHandler, WorkbenchPhase.BlockRestore); - registerWorkbenchContribution2(DynamicEditorConfigurations.ID, DynamicEditorConfigurations, WorkbenchPhase.BlockRestore); -diff --git a/src/vs/workbench/contrib/files/browser/fileCommands._save.ts b/src/vs/workbench/contrib/files/browser/fileCommands._save.ts -new file mode 100644 -index 00000000000..00d9d64137d ---- /dev/null -+++ b/src/vs/workbench/contrib/files/browser/fileCommands._save.ts -@@ -0,0 +1,225 @@ -+/*--------------------------------------------------------------------------------------------- -+ * Copyright (c) Microsoft Corporation. All rights reserved. -+ * Licensed under the MIT License. See License.txt in the project root for license information. -+ *--------------------------------------------------------------------------------------------*/ -+ -+import * as nls from 'vs/nls'; -+import { URI } from 'vs/base/common/uri'; -+import { EditorResourceAccessor, IEditorCommandsContext, SideBySideEditor, IEditorIdentifier, SaveReason, EditorsOrder, EditorInputCapabilities } from 'vs/workbench/common/editor'; -+import { SideBySideEditorInput } from 'vs/workbench/common/editor/sideBySideEditorInput'; -+import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -+import { toErrorMessage } from 'vs/base/common/errorMessage'; -+import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -+import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -+import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes'; -+import { getOpenEditorsViewMultiSelection } from 'vs/workbench/contrib/files/browser/files'; -+import { resolveCommandsContext } from 'vs/workbench/browser/parts/editor/editorCommandsContext'; -+import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; -+import { IEditorService, ISaveEditorsOptions } from 'vs/workbench/services/editor/common/editorService'; -+import { IEditorGroupsService, GroupsOrder, IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService'; -+import { isEqual } from 'vs/base/common/resources'; -+import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -+import { EmbeddedCodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/embeddedCodeEditorWidget'; -+import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -+import { isCancellationError } from 'vs/base/common/errors'; -+import { toAction, IAction } from 'vs/base/common/actions'; -+import { hash } from 'vs/base/common/hash'; -+import { SAVE_FILE_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, SAVE_FILE_AS_COMMAND_ID, SAVE_ALL_COMMAND_ID, SAVE_ALL_IN_GROUP_COMMAND_ID, SAVE_FILES_COMMAND_ID, REVERT_FILE_COMMAND_ID } from './fileConstants'; -+import { IListService } from 'vs/platform/list/browser/listService'; -+ -+async function saveSelectedEditors(accessor: ServicesAccessor, options?: ISaveEditorsOptions): Promise { -+ const editorGroupService = accessor.get(IEditorGroupsService); -+ const codeEditorService = accessor.get(ICodeEditorService); -+ const textFileService = accessor.get(ITextFileService); -+ -+ // Retrieve selected or active editor -+ let editors = getOpenEditorsViewMultiSelection(accessor); -+ if (!editors) { -+ const activeGroup = editorGroupService.activeGroup; -+ if (activeGroup.activeEditor) { -+ editors = []; -+ -+ // Special treatment for side by side editors: if the active editor -+ // has 2 sides, we consider both, to support saving both sides. -+ // We only allow this when saving, not for "Save As" and not if any -+ // editor is untitled which would bring up a "Save As" dialog too. -+ // In addition, we require the secondary side to be modified to not -+ // trigger a touch operation unexpectedly. -+ // -+ // See also https://github.com/microsoft/vscode/issues/4180 -+ // See also https://github.com/microsoft/vscode/issues/106330 -+ // See also https://github.com/microsoft/vscode/issues/190210 -+ if ( -+ activeGroup.activeEditor instanceof SideBySideEditorInput && -+ !options?.saveAs && !(activeGroup.activeEditor.primary.hasCapability(EditorInputCapabilities.Untitled) || activeGroup.activeEditor.secondary.hasCapability(EditorInputCapabilities.Untitled)) && -+ activeGroup.activeEditor.secondary.isModified() -+ ) { -+ editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.primary }); -+ editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.secondary }); -+ } else { -+ editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor }); -+ } -+ } -+ } -+ -+ if (!editors || editors.length === 0) { -+ return; // nothing to save -+ } -+ -+ // Save editors -+ await doSaveEditors(accessor, editors, options); -+ -+ // Special treatment for embedded editors: if we detect that focus is -+ // inside an embedded code editor, we save that model as well if we -+ // find it in our text file models. Currently, only textual editors -+ // support embedded editors. -+ const focusedCodeEditor = codeEditorService.getFocusedCodeEditor(); -+ if (focusedCodeEditor instanceof EmbeddedCodeEditorWidget && !focusedCodeEditor.isSimpleWidget) { -+ const resource = focusedCodeEditor.getModel()?.uri; -+ -+ // Check that the resource of the model was not saved already -+ if (resource && !editors.some(({ editor }) => isEqual(EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.PRIMARY }), resource))) { -+ const model = textFileService.files.get(resource); -+ if (!model?.isReadonly()) { -+ await textFileService.save(resource, options); -+ } -+ } -+ } -+} -+ -+function saveDirtyEditorsOfGroups(accessor: ServicesAccessor, groups: readonly IEditorGroup[], options?: ISaveEditorsOptions): Promise { -+ const dirtyEditors: IEditorIdentifier[] = []; -+ for (const group of groups) { -+ for (const editor of group.getEditors(EditorsOrder.MOST_RECENTLY_ACTIVE)) { -+ if (editor.isDirty()) { -+ dirtyEditors.push({ groupId: group.id, editor }); -+ } -+ } -+ } -+ -+ return doSaveEditors(accessor, dirtyEditors, options); -+} -+ -+async function doSaveEditors(accessor: ServicesAccessor, editors: IEditorIdentifier[], options?: ISaveEditorsOptions): Promise { -+ const editorService = accessor.get(IEditorService); -+ const notificationService = accessor.get(INotificationService); -+ const instantiationService = accessor.get(IInstantiationService); -+ -+ try { -+ await editorService.save(editors, options); -+ } catch (error) { -+ if (!isCancellationError(error)) { -+ const actions: IAction[] = [toAction({ id: 'workbench.action.files.saveEditors', label: nls.localize('retry', "Retry"), run: () => instantiationService.invokeFunction(accessor => doSaveEditors(accessor, editors, options)) })]; -+ const editorsToRevert = editors.filter(({ editor }) => !editor.hasCapability(EditorInputCapabilities.Untitled) /* all except untitled to prevent unexpected data-loss */); -+ if (editorsToRevert.length > 0) { -+ actions.push(toAction({ id: 'workbench.action.files.revertEditors', label: editorsToRevert.length > 1 ? nls.localize('revertAll', "Revert All") : nls.localize('revert', "Revert"), run: () => editorService.revert(editorsToRevert) })); -+ } -+ -+ notificationService.notify({ -+ id: editors.map(({ editor }) => hash(editor.resource?.toString())).join(), // ensure unique notification ID per set of editor -+ severity: Severity.Error, -+ message: nls.localize({ key: 'genericSaveError', comment: ['{0} is the resource that failed to save and {1} the error message'] }, "Failed to save '{0}': {1}", editors.map(({ editor }) => editor.getName()).join(', '), toErrorMessage(error, false)), -+ actions: { primary: actions } -+ }); -+ } -+ } -+} -+ -+KeybindingsRegistry.registerCommandAndKeybindingRule({ -+ when: undefined, -+ weight: KeybindingWeight.WorkbenchContrib, -+ primary: KeyMod.CtrlCmd | KeyCode.KeyS, -+ id: SAVE_FILE_COMMAND_ID, -+ handler: accessor => { -+ return saveSelectedEditors(accessor, { reason: SaveReason.EXPLICIT, force: true /* force save even when non-dirty */ }); -+ } -+}); -+ -+KeybindingsRegistry.registerCommandAndKeybindingRule({ -+ when: undefined, -+ weight: KeybindingWeight.WorkbenchContrib, -+ primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyS), -+ win: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyS) }, -+ id: SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, -+ handler: accessor => { -+ return saveSelectedEditors(accessor, { reason: SaveReason.EXPLICIT, force: true /* force save even when non-dirty */, skipSaveParticipants: true }); -+ } -+}); -+ -+KeybindingsRegistry.registerCommandAndKeybindingRule({ -+ id: SAVE_FILE_AS_COMMAND_ID, -+ weight: KeybindingWeight.WorkbenchContrib, -+ when: undefined, -+ primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyS, -+ handler: accessor => { -+ return saveSelectedEditors(accessor, { reason: SaveReason.EXPLICIT, saveAs: true }); -+ } -+}); -+ -+KeybindingsRegistry.registerCommandAndKeybindingRule({ -+ when: undefined, -+ weight: KeybindingWeight.WorkbenchContrib, -+ primary: undefined, -+ mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyS }, -+ win: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyS) }, -+ id: SAVE_ALL_COMMAND_ID, -+ handler: accessor => { -+ return saveDirtyEditorsOfGroups(accessor, accessor.get(IEditorGroupsService).getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE), { reason: SaveReason.EXPLICIT }); -+ } -+}); -+ -+CommandsRegistry.registerCommand({ -+ id: SAVE_ALL_IN_GROUP_COMMAND_ID, -+ handler: (accessor, _: URI | object, editorContext: IEditorCommandsContext) => { -+ const editorGroupsService = accessor.get(IEditorGroupsService); -+ -+ const resolvedContext = resolveCommandsContext([editorContext], accessor.get(IEditorService), editorGroupsService, accessor.get(IListService)); -+ -+ let groups: readonly IEditorGroup[] | undefined = undefined; -+ if (!resolvedContext.groupedEditors.length) { -+ groups = editorGroupsService.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE); -+ } else { -+ groups = resolvedContext.groupedEditors.map(({ group }) => group); -+ } -+ -+ return saveDirtyEditorsOfGroups(accessor, groups, { reason: SaveReason.EXPLICIT }); -+ } -+}); -+ -+CommandsRegistry.registerCommand({ -+ id: SAVE_FILES_COMMAND_ID, -+ handler: async accessor => { -+ const editorService = accessor.get(IEditorService); -+ -+ const res = await editorService.saveAll({ includeUntitled: false, reason: SaveReason.EXPLICIT }); -+ return res.success; -+ } -+}); -+ -+CommandsRegistry.registerCommand({ -+ id: REVERT_FILE_COMMAND_ID, -+ handler: async accessor => { -+ const editorGroupService = accessor.get(IEditorGroupsService); -+ const editorService = accessor.get(IEditorService); -+ -+ // Retrieve selected or active editor -+ let editors = getOpenEditorsViewMultiSelection(accessor); -+ if (!editors) { -+ const activeGroup = editorGroupService.activeGroup; -+ if (activeGroup.activeEditor) { -+ editors = [{ groupId: activeGroup.id, editor: activeGroup.activeEditor }]; -+ } -+ } -+ -+ if (!editors || editors.length === 0) { -+ return; // nothing to revert -+ } -+ -+ try { -+ await editorService.revert(editors.filter(({ editor }) => !editor.hasCapability(EditorInputCapabilities.Untitled) /* all except untitled */), { force: true }); -+ } catch (error) { -+ const notificationService = accessor.get(INotificationService); -+ notificationService.error(nls.localize('genericRevertError', "Failed to revert '{0}': {1}", editors.map(({ editor }) => editor.getName()).join(', '), toErrorMessage(error, false))); -+ } -+ } -+}); -diff --git a/src/vs/workbench/contrib/files/browser/fileCommands.ts b/src/vs/workbench/contrib/files/browser/fileCommands.ts -index 69cfd27a424..484b77a02f7 100644 ---- a/src/vs/workbench/contrib/files/browser/fileCommands.ts -+++ b/src/vs/workbench/contrib/files/browser/fileCommands.ts -@@ -5,8 +5,7 @@ - - import * as nls from '../../../../nls.js'; - import { URI } from '../../../../base/common/uri.js'; --import { EditorResourceAccessor, IEditorCommandsContext, SideBySideEditor, IEditorIdentifier, SaveReason, EditorsOrder, EditorInputCapabilities } from '../../../common/editor.js'; --import { SideBySideEditorInput } from '../../../common/editor/sideBySideEditorInput.js'; -+import { EditorResourceAccessor, SideBySideEditor } from '../../../common/editor.js'; - import { IWindowOpenable, IOpenWindowOptions, isWorkspaceToOpen, IOpenEmptyWindowOptions } from '../../../../platform/window/common/window.js'; - import { IHostService } from '../../../services/host/browser/host.js'; - import { ServicesAccessor, IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; -@@ -14,7 +13,6 @@ import { IWorkspaceContextService, UNTITLED_WORKSPACE_NAME } from '../../../../p - import { ExplorerFocusCondition, TextFileContentProvider, VIEWLET_ID, ExplorerCompressedFocusContext, ExplorerCompressedFirstFocusContext, ExplorerCompressedLastFocusContext, FilesExplorerFocusCondition, ExplorerFolderContext, VIEW_ID } from '../common/files.js'; - import { ExplorerViewPaneContainer } from './explorerViewlet.js'; - import { IClipboardService } from '../../../../platform/clipboard/common/clipboardService.js'; --import { toErrorMessage } from '../../../../base/common/errorMessage.js'; - import { CommandsRegistry, ICommandHandler, ICommandService } from '../../../../platform/commands/common/commands.js'; - import { IContextKey, IContextKeyService, ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; - import { IFileService } from '../../../../platform/files/common/files.js'; -@@ -22,36 +20,29 @@ import { KeybindingsRegistry, KeybindingWeight } from '../../../../platform/keyb - import { KeyMod, KeyCode, KeyChord } from '../../../../base/common/keyCodes.js'; - import { isWeb, isWindows } from '../../../../base/common/platform.js'; - import { ITextModelService } from '../../../../editor/common/services/resolverService.js'; --import { getResourceForCommand, getMultiSelectedResources, getOpenEditorsViewMultiSelection, IExplorerService } from './files.js'; -+import { getResourceForCommand, getMultiSelectedResources, IExplorerService } from './files.js'; - import { IWorkspaceEditingService } from '../../../services/workspaces/common/workspaceEditing.js'; --import { resolveCommandsContext } from '../../../browser/parts/editor/editorCommandsContext.js'; - import { Schemas } from '../../../../base/common/network.js'; --import { INotificationService, Severity } from '../../../../platform/notification/common/notification.js'; - import { EditorContextKeys } from '../../../../editor/common/editorContextKeys.js'; --import { IEditorService, SIDE_GROUP, ISaveEditorsOptions } from '../../../services/editor/common/editorService.js'; --import { IEditorGroupsService, GroupsOrder, IEditorGroup } from '../../../services/editor/common/editorGroupsService.js'; -+import { IEditorService, SIDE_GROUP } from '../../../services/editor/common/editorService.js'; -+import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; - import { ILabelService } from '../../../../platform/label/common/label.js'; --import { basename, joinPath, isEqual } from '../../../../base/common/resources.js'; -+import { basename, joinPath } from '../../../../base/common/resources.js'; - import { IDisposable, dispose } from '../../../../base/common/lifecycle.js'; - import { IEnvironmentService } from '../../../../platform/environment/common/environment.js'; --import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js'; --import { EmbeddedCodeEditorWidget } from '../../../../editor/browser/widget/codeEditor/embeddedCodeEditorWidget.js'; --import { ITextFileService } from '../../../services/textfile/common/textfiles.js'; - import { IUriIdentityService } from '../../../../platform/uriIdentity/common/uriIdentity.js'; --import { isCancellationError } from '../../../../base/common/errors.js'; --import { IAction, toAction } from '../../../../base/common/actions.js'; - import { EditorOpenSource, EditorResolution } from '../../../../platform/editor/common/editor.js'; --import { hash } from '../../../../base/common/hash.js'; - import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; - import { IPaneCompositePartService } from '../../../services/panecomposite/browser/panecomposite.js'; - import { ViewContainerLocation } from '../../../common/views.js'; - import { IViewsService } from '../../../services/views/common/viewsService.js'; --import { OPEN_TO_SIDE_COMMAND_ID, COMPARE_WITH_SAVED_COMMAND_ID, SELECT_FOR_COMPARE_COMMAND_ID, ResourceSelectedForCompareContext, COMPARE_SELECTED_COMMAND_ID, COMPARE_RESOURCE_COMMAND_ID, COPY_PATH_COMMAND_ID, COPY_RELATIVE_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, OPEN_WITH_EXPLORER_COMMAND_ID, SAVE_FILE_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, SAVE_FILE_AS_COMMAND_ID, SAVE_ALL_COMMAND_ID, SAVE_ALL_IN_GROUP_COMMAND_ID, SAVE_FILES_COMMAND_ID, REVERT_FILE_COMMAND_ID, REMOVE_ROOT_FOLDER_COMMAND_ID, PREVIOUS_COMPRESSED_FOLDER, NEXT_COMPRESSED_FOLDER, FIRST_COMPRESSED_FOLDER, LAST_COMPRESSED_FOLDER, NEW_UNTITLED_FILE_COMMAND_ID, NEW_UNTITLED_FILE_LABEL, NEW_FILE_COMMAND_ID } from './fileConstants.js'; -+import { OPEN_TO_SIDE_COMMAND_ID, COMPARE_WITH_SAVED_COMMAND_ID, SELECT_FOR_COMPARE_COMMAND_ID, ResourceSelectedForCompareContext, COMPARE_SELECTED_COMMAND_ID, COMPARE_RESOURCE_COMMAND_ID, COPY_PATH_COMMAND_ID, COPY_RELATIVE_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, OPEN_WITH_EXPLORER_COMMAND_ID, REMOVE_ROOT_FOLDER_COMMAND_ID, PREVIOUS_COMPRESSED_FOLDER, NEXT_COMPRESSED_FOLDER, FIRST_COMPRESSED_FOLDER, LAST_COMPRESSED_FOLDER, NEW_UNTITLED_FILE_COMMAND_ID, NEW_UNTITLED_FILE_LABEL, NEW_FILE_COMMAND_ID } from './fileConstants.js'; - import { IFileDialogService } from '../../../../platform/dialogs/common/dialogs.js'; - import { RemoveRootFolderAction } from '../../../browser/actions/workspaceActions.js'; - import { OpenEditorsView } from './views/openEditorsView.js'; - import { ExplorerView } from './views/explorerView.js'; - import { IListService } from '../../../../platform/list/browser/listService.js'; -+import './fileCommands._save.js'; - - export const openWindowCommand = (accessor: ServicesAccessor, toOpen: IWindowOpenable[], options?: IOpenWindowOptions) => { - if (Array.isArray(toOpen)) { -@@ -364,203 +355,6 @@ CommandsRegistry.registerCommand({ - - // Save / Save As / Save All / Revert - --async function saveSelectedEditors(accessor: ServicesAccessor, options?: ISaveEditorsOptions): Promise { -- const editorGroupService = accessor.get(IEditorGroupsService); -- const codeEditorService = accessor.get(ICodeEditorService); -- const textFileService = accessor.get(ITextFileService); -- -- // Retrieve selected or active editor -- let editors = getOpenEditorsViewMultiSelection(accessor); -- if (!editors) { -- const activeGroup = editorGroupService.activeGroup; -- if (activeGroup.activeEditor) { -- editors = []; -- -- // Special treatment for side by side editors: if the active editor -- // has 2 sides, we consider both, to support saving both sides. -- // We only allow this when saving, not for "Save As" and not if any -- // editor is untitled which would bring up a "Save As" dialog too. -- // In addition, we require the secondary side to be modified to not -- // trigger a touch operation unexpectedly. -- // -- // See also https://github.com/microsoft/vscode/issues/4180 -- // See also https://github.com/microsoft/vscode/issues/106330 -- // See also https://github.com/microsoft/vscode/issues/190210 -- if ( -- activeGroup.activeEditor instanceof SideBySideEditorInput && -- !options?.saveAs && !(activeGroup.activeEditor.primary.hasCapability(EditorInputCapabilities.Untitled) || activeGroup.activeEditor.secondary.hasCapability(EditorInputCapabilities.Untitled)) && -- activeGroup.activeEditor.secondary.isModified() -- ) { -- editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.primary }); -- editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor.secondary }); -- } else { -- editors.push({ groupId: activeGroup.id, editor: activeGroup.activeEditor }); -- } -- } -- } -- -- if (!editors || editors.length === 0) { -- return; // nothing to save -- } -- -- // Save editors -- await doSaveEditors(accessor, editors, options); -- -- // Special treatment for embedded editors: if we detect that focus is -- // inside an embedded code editor, we save that model as well if we -- // find it in our text file models. Currently, only textual editors -- // support embedded editors. -- const focusedCodeEditor = codeEditorService.getFocusedCodeEditor(); -- if (focusedCodeEditor instanceof EmbeddedCodeEditorWidget && !focusedCodeEditor.isSimpleWidget) { -- const resource = focusedCodeEditor.getModel()?.uri; -- -- // Check that the resource of the model was not saved already -- if (resource && !editors.some(({ editor }) => isEqual(EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.PRIMARY }), resource))) { -- const model = textFileService.files.get(resource); -- if (!model?.isReadonly()) { -- await textFileService.save(resource, options); -- } -- } -- } --} -- --function saveDirtyEditorsOfGroups(accessor: ServicesAccessor, groups: readonly IEditorGroup[], options?: ISaveEditorsOptions): Promise { -- const dirtyEditors: IEditorIdentifier[] = []; -- for (const group of groups) { -- for (const editor of group.getEditors(EditorsOrder.MOST_RECENTLY_ACTIVE)) { -- if (editor.isDirty()) { -- dirtyEditors.push({ groupId: group.id, editor }); -- } -- } -- } -- -- return doSaveEditors(accessor, dirtyEditors, options); --} -- --async function doSaveEditors(accessor: ServicesAccessor, editors: IEditorIdentifier[], options?: ISaveEditorsOptions): Promise { -- const editorService = accessor.get(IEditorService); -- const notificationService = accessor.get(INotificationService); -- const instantiationService = accessor.get(IInstantiationService); -- -- try { -- await editorService.save(editors, options); -- } catch (error) { -- if (!isCancellationError(error)) { -- const actions: IAction[] = [toAction({ id: 'workbench.action.files.saveEditors', label: nls.localize('retry', "Retry"), run: () => instantiationService.invokeFunction(accessor => doSaveEditors(accessor, editors, options)) })]; -- const editorsToRevert = editors.filter(({ editor }) => !editor.hasCapability(EditorInputCapabilities.Untitled) /* all except untitled to prevent unexpected data-loss */); -- if (editorsToRevert.length > 0) { -- actions.push(toAction({ id: 'workbench.action.files.revertEditors', label: editorsToRevert.length > 1 ? nls.localize('revertAll', "Revert All") : nls.localize('revert', "Revert"), run: () => editorService.revert(editorsToRevert) })); -- } -- -- notificationService.notify({ -- id: editors.map(({ editor }) => hash(editor.resource?.toString())).join(), // ensure unique notification ID per set of editor -- severity: Severity.Error, -- message: nls.localize({ key: 'genericSaveError', comment: ['{0} is the resource that failed to save and {1} the error message'] }, "Failed to save '{0}': {1}", editors.map(({ editor }) => editor.getName()).join(', '), toErrorMessage(error, false)), -- actions: { primary: actions } -- }); -- } -- } --} -- --KeybindingsRegistry.registerCommandAndKeybindingRule({ -- when: undefined, -- weight: KeybindingWeight.WorkbenchContrib, -- primary: KeyMod.CtrlCmd | KeyCode.KeyS, -- id: SAVE_FILE_COMMAND_ID, -- handler: accessor => { -- return saveSelectedEditors(accessor, { reason: SaveReason.EXPLICIT, force: true /* force save even when non-dirty */ }); -- } --}); -- --KeybindingsRegistry.registerCommandAndKeybindingRule({ -- when: undefined, -- weight: KeybindingWeight.WorkbenchContrib, -- primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyS), -- win: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyS) }, -- id: SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, -- handler: accessor => { -- return saveSelectedEditors(accessor, { reason: SaveReason.EXPLICIT, force: true /* force save even when non-dirty */, skipSaveParticipants: true }); -- } --}); -- --KeybindingsRegistry.registerCommandAndKeybindingRule({ -- id: SAVE_FILE_AS_COMMAND_ID, -- weight: KeybindingWeight.WorkbenchContrib, -- when: undefined, -- primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyS, -- handler: accessor => { -- return saveSelectedEditors(accessor, { reason: SaveReason.EXPLICIT, saveAs: true }); -- } --}); -- --KeybindingsRegistry.registerCommandAndKeybindingRule({ -- when: undefined, -- weight: KeybindingWeight.WorkbenchContrib, -- primary: undefined, -- mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyS }, -- win: { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyS) }, -- id: SAVE_ALL_COMMAND_ID, -- handler: accessor => { -- return saveDirtyEditorsOfGroups(accessor, accessor.get(IEditorGroupsService).getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE), { reason: SaveReason.EXPLICIT }); -- } --}); -- --CommandsRegistry.registerCommand({ -- id: SAVE_ALL_IN_GROUP_COMMAND_ID, -- handler: (accessor, _: URI | object, editorContext: IEditorCommandsContext) => { -- const editorGroupsService = accessor.get(IEditorGroupsService); -- -- const resolvedContext = resolveCommandsContext([editorContext], accessor.get(IEditorService), editorGroupsService, accessor.get(IListService)); -- -- let groups: readonly IEditorGroup[] | undefined = undefined; -- if (!resolvedContext.groupedEditors.length) { -- groups = editorGroupsService.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE); -- } else { -- groups = resolvedContext.groupedEditors.map(({ group }) => group); -- } -- -- return saveDirtyEditorsOfGroups(accessor, groups, { reason: SaveReason.EXPLICIT }); -- } --}); -- --CommandsRegistry.registerCommand({ -- id: SAVE_FILES_COMMAND_ID, -- handler: async accessor => { -- const editorService = accessor.get(IEditorService); -- -- const res = await editorService.saveAll({ includeUntitled: false, reason: SaveReason.EXPLICIT }); -- return res.success; -- } --}); -- --CommandsRegistry.registerCommand({ -- id: REVERT_FILE_COMMAND_ID, -- handler: async accessor => { -- const editorGroupService = accessor.get(IEditorGroupsService); -- const editorService = accessor.get(IEditorService); -- -- // Retrieve selected or active editor -- let editors = getOpenEditorsViewMultiSelection(accessor); -- if (!editors) { -- const activeGroup = editorGroupService.activeGroup; -- if (activeGroup.activeEditor) { -- editors = [{ groupId: activeGroup.id, editor: activeGroup.activeEditor }]; -- } -- } -- -- if (!editors || editors.length === 0) { -- return; // nothing to revert -- } -- -- try { -- await editorService.revert(editors.filter(({ editor }) => !editor.hasCapability(EditorInputCapabilities.Untitled) /* all except untitled */), { force: true }); -- } catch (error) { -- const notificationService = accessor.get(INotificationService); -- notificationService.error(nls.localize('genericRevertError', "Failed to revert '{0}': {1}", editors.map(({ editor }) => editor.getName()).join(', '), toErrorMessage(error, false))); -- } -- } --}); -- - CommandsRegistry.registerCommand({ - id: REMOVE_ROOT_FOLDER_COMMAND_ID, - handler: (accessor, resource: URI | object) => { -diff --git a/src/vs/workbench/contrib/files/browser/files.contribution._configuration.ts b/src/vs/workbench/contrib/files/browser/files.contribution._configuration.ts -new file mode 100644 -index 00000000000..b7d4ca80081 ---- /dev/null -+++ b/src/vs/workbench/contrib/files/browser/files.contribution._configuration.ts -@@ -0,0 +1,297 @@ -+/*--------------------------------------------------------------------------------------------- -+ * Copyright (c) Microsoft Corporation. All rights reserved. -+ * Licensed under the MIT License. See License.txt in the project root for license information. -+ *--------------------------------------------------------------------------------------------*/ -+ -+import { isNative, isWeb } from 'vs/base/common/platform'; -+import { editorConfigurationBaseNode } from 'vs/editor/common/config/editorConfigurationSchema'; -+import * as nls from 'vs/nls'; -+import { Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationPropertySchema, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -+import { AutoSaveConfiguration, FILES_ASSOCIATIONS_CONFIG, FILES_EXCLUDE_CONFIG, FILES_READONLY_EXCLUDE_CONFIG, FILES_READONLY_FROM_PERMISSIONS_CONFIG, FILES_READONLY_INCLUDE_CONFIG, HotExitConfiguration } from 'vs/platform/files/common/files'; -+import { Registry } from 'vs/platform/registry/common/platform'; -+import { GUESSABLE_ENCODINGS, SUPPORTED_ENCODINGS } from 'vs/workbench/services/textfile/common/encoding'; -+ -+// Configuration -+const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); -+ -+const hotExitConfiguration: IConfigurationPropertySchema = isNative ? -+ { -+ 'type': 'string', -+ 'scope': ConfigurationScope.APPLICATION, -+ 'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE], -+ 'default': HotExitConfiguration.ON_EXIT, -+ 'markdownEnumDescriptions': [ -+ nls.localize('hotExit.off', 'Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes.'), -+ nls.localize('hotExit.onExit', 'Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu). All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`'), -+ nls.localize('hotExit.onExitAndWindowClose', 'Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu), and also for any window with a folder opened regardless of whether it\'s the last window. All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`') -+ ], -+ 'markdownDescription': nls.localize('hotExit', "[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.", HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) -+ } : { -+ 'type': 'string', -+ 'scope': ConfigurationScope.APPLICATION, -+ 'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE], -+ 'default': HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE, -+ 'markdownEnumDescriptions': [ -+ nls.localize('hotExit.off', 'Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes.'), -+ nls.localize('hotExit.onExitAndWindowCloseBrowser', 'Hot exit will be triggered when the browser quits or the window or tab is closed.') -+ ], -+ 'markdownDescription': nls.localize('hotExit', "[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.", HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) -+ }; -+ -+configurationRegistry.registerConfiguration({ -+ 'id': 'files', -+ 'order': 9, -+ 'title': nls.localize('filesConfigurationTitle', "Files"), -+ 'type': 'object', -+ 'properties': { -+ [FILES_EXCLUDE_CONFIG]: { -+ 'type': 'object', -+ 'markdownDescription': nls.localize('exclude', "Configure [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files and folders. For example, the File Explorer decides which files and folders to show or hide based on this setting. Refer to the `#search.exclude#` setting to define search-specific excludes. Refer to the `#explorer.excludeGitIgnore#` setting for ignoring files based on your `.gitignore`."), -+ 'default': { -+ ...{ '**/.git': true, '**/.svn': true, '**/.hg': true, '**/CVS': true, '**/.DS_Store': true, '**/Thumbs.db': true }, -+ ...(isWeb ? { '**/*.crswap': true /* filter out swap files used for local file access */ } : undefined) -+ }, -+ 'scope': ConfigurationScope.RESOURCE, -+ 'additionalProperties': { -+ 'anyOf': [ -+ { -+ 'type': 'boolean', -+ 'enum': [true, false], -+ 'enumDescriptions': [nls.localize('trueDescription', "Enable the pattern."), nls.localize('falseDescription', "Disable the pattern.")], -+ 'description': nls.localize('files.exclude.boolean', "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern."), -+ }, -+ { -+ 'type': 'object', -+ 'properties': { -+ 'when': { -+ 'type': 'string', // expression ({ "**/*.js": { "when": "$(basename).js" } }) -+ 'pattern': '\\w*\\$\\(basename\\)\\w*', -+ 'default': '$(basename).ext', -+ 'markdownDescription': nls.localize({ key: 'files.exclude.when', comment: ['\\$(basename) should not be translated'] }, "Additional check on the siblings of a matching file. Use \\$(basename) as variable for the matching file name.") -+ } -+ } -+ } -+ ] -+ } -+ }, -+ [FILES_ASSOCIATIONS_CONFIG]: { -+ 'type': 'object', -+ 'markdownDescription': nls.localize('associations', "Configure [glob patterns](https://aka.ms/vscode-glob-patterns) of file associations to languages (for example `\"*.extension\": \"html\"`). Patterns will match on the absolute path of a file if they contain a path separator and will match on the name of the file otherwise. These have precedence over the default associations of the languages installed."), -+ 'additionalProperties': { -+ 'type': 'string' -+ } -+ }, -+ 'files.encoding': { -+ 'type': 'string', -+ 'enum': Object.keys(SUPPORTED_ENCODINGS), -+ 'default': 'utf8', -+ 'description': nls.localize('encoding', "The default character set encoding to use when reading and writing files. This setting can also be configured per language."), -+ 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE, -+ 'enumDescriptions': Object.keys(SUPPORTED_ENCODINGS).map(key => SUPPORTED_ENCODINGS[key].labelLong), -+ 'enumItemLabels': Object.keys(SUPPORTED_ENCODINGS).map(key => SUPPORTED_ENCODINGS[key].labelLong) -+ }, -+ 'files.autoGuessEncoding': { -+ 'type': 'boolean', -+ 'default': false, -+ 'markdownDescription': nls.localize('autoGuessEncoding', "When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only {0} is respected.", '`#files.encoding#`'), -+ 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -+ }, -+ 'files.candidateGuessEncodings': { -+ 'type': 'array', -+ 'items': { -+ 'type': 'string', -+ 'enum': Object.keys(GUESSABLE_ENCODINGS), -+ 'enumDescriptions': Object.keys(GUESSABLE_ENCODINGS).map(key => GUESSABLE_ENCODINGS[key].labelLong) -+ }, -+ 'default': [], -+ 'markdownDescription': nls.localize('candidateGuessEncodings', "List of character set encodings that the editor should attempt to guess in the order they are listed. In case it cannot be determined, {0} is respected", '`#files.encoding#`'), -+ 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -+ }, -+ 'files.eol': { -+ 'type': 'string', -+ 'enum': [ -+ '\n', -+ '\r\n', -+ 'auto' -+ ], -+ 'enumDescriptions': [ -+ nls.localize('eol.LF', "LF"), -+ nls.localize('eol.CRLF', "CRLF"), -+ nls.localize('eol.auto', "Uses operating system specific end of line character.") -+ ], -+ 'default': 'auto', -+ 'description': nls.localize('eol', "The default end of line character."), -+ 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -+ }, -+ 'files.enableTrash': { -+ 'type': 'boolean', -+ 'default': true, -+ 'description': nls.localize('useTrash', "Moves files/folders to the OS trash (recycle bin on Windows) when deleting. Disabling this will delete files/folders permanently.") -+ }, -+ 'files.trimTrailingWhitespace': { -+ 'type': 'boolean', -+ 'default': false, -+ 'description': nls.localize('trimTrailingWhitespace', "When enabled, will trim trailing whitespace when saving a file."), -+ 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -+ }, -+ 'files.trimTrailingWhitespaceInRegexAndStrings': { -+ 'type': 'boolean', -+ 'default': true, -+ 'description': nls.localize('trimTrailingWhitespaceInRegexAndStrings', "When enabled, trailing whitespace will be removed from multiline strings and regexes will be removed on save or when executing 'editor.action.trimTrailingWhitespace'. This can cause whitespace to not be trimmed from lines when there isn't up-to-date token information."), -+ 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -+ }, -+ 'files.insertFinalNewline': { -+ 'type': 'boolean', -+ 'default': false, -+ 'description': nls.localize('insertFinalNewline', "When enabled, insert a final new line at the end of the file when saving it."), -+ 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -+ }, -+ 'files.trimFinalNewlines': { -+ 'type': 'boolean', -+ 'default': false, -+ 'description': nls.localize('trimFinalNewlines', "When enabled, will trim all new lines after the final new line at the end of the file when saving it."), -+ scope: ConfigurationScope.LANGUAGE_OVERRIDABLE, -+ }, -+ 'files.autoSave': { -+ 'type': 'string', -+ 'enum': [AutoSaveConfiguration.OFF, AutoSaveConfiguration.AFTER_DELAY, AutoSaveConfiguration.ON_FOCUS_CHANGE, AutoSaveConfiguration.ON_WINDOW_CHANGE], -+ 'markdownEnumDescriptions': [ -+ nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.off' }, "An editor with changes is never automatically saved."), -+ nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.afterDelay' }, "An editor with changes is automatically saved after the configured `#files.autoSaveDelay#`."), -+ nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.onFocusChange' }, "An editor with changes is automatically saved when the editor loses focus."), -+ nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.onWindowChange' }, "An editor with changes is automatically saved when the window loses focus.") -+ ], -+ 'default': isWeb ? AutoSaveConfiguration.AFTER_DELAY : AutoSaveConfiguration.OFF, -+ 'markdownDescription': nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'autoSave' }, "Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.", AutoSaveConfiguration.OFF, AutoSaveConfiguration.AFTER_DELAY, AutoSaveConfiguration.ON_FOCUS_CHANGE, AutoSaveConfiguration.ON_WINDOW_CHANGE, AutoSaveConfiguration.AFTER_DELAY), -+ scope: ConfigurationScope.LANGUAGE_OVERRIDABLE -+ }, -+ 'files.autoSaveDelay': { -+ 'type': 'number', -+ 'default': 1000, -+ 'minimum': 0, -+ 'markdownDescription': nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'autoSaveDelay' }, "Controls the delay in milliseconds after which an editor with unsaved changes is saved automatically. Only applies when `#files.autoSave#` is set to `{0}`.", AutoSaveConfiguration.AFTER_DELAY), -+ scope: ConfigurationScope.LANGUAGE_OVERRIDABLE -+ }, -+ 'files.autoSaveWorkspaceFilesOnly': { -+ 'type': 'boolean', -+ 'default': false, -+ 'markdownDescription': nls.localize('autoSaveWorkspaceFilesOnly', "When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that are inside the opened workspace. Only applies when {0} is enabled.", '`#files.autoSave#`'), -+ scope: ConfigurationScope.LANGUAGE_OVERRIDABLE -+ }, -+ 'files.autoSaveWhenNoErrors': { -+ 'type': 'boolean', -+ 'default': false, -+ 'markdownDescription': nls.localize('autoSaveWhenNoErrors', "When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that have no errors reported in them at the time the auto save is triggered. Only applies when {0} is enabled.", '`#files.autoSave#`'), -+ scope: ConfigurationScope.LANGUAGE_OVERRIDABLE -+ }, -+ 'files.watcherExclude': { -+ 'type': 'object', -+ 'patternProperties': { -+ '.*': { 'type': 'boolean' } -+ }, -+ 'default': { '**/.git/objects/**': true, '**/.git/subtree-cache/**': true, '**/.hg/store/**': true }, -+ 'markdownDescription': nls.localize('watcherExclude', "Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from file watching. Paths can either be relative to the watched folder or absolute. Glob patterns are matched relative from the watched folder. When you experience the file watcher process consuming a lot of CPU, make sure to exclude large folders that are of less interest (such as build output folders)."), -+ 'scope': ConfigurationScope.RESOURCE -+ }, -+ 'files.watcherInclude': { -+ 'type': 'array', -+ 'items': { -+ 'type': 'string' -+ }, -+ 'default': [], -+ 'description': nls.localize('watcherInclude', "Configure extra paths to watch for changes inside the workspace. By default, all workspace folders will be watched recursively, except for folders that are symbolic links. You can explicitly add absolute or relative paths to support watching folders that are symbolic links. Relative paths will be resolved to an absolute path using the currently opened workspace."), -+ 'scope': ConfigurationScope.RESOURCE -+ }, -+ 'files.hotExit': hotExitConfiguration, -+ 'files.defaultLanguage': { -+ 'type': 'string', -+ 'markdownDescription': nls.localize('defaultLanguage', "The default language identifier that is assigned to new files. If configured to `${activeEditorLanguage}`, will use the language identifier of the currently active text editor if any.") -+ }, -+ [FILES_READONLY_INCLUDE_CONFIG]: { -+ 'type': 'object', -+ 'patternProperties': { -+ '.*': { 'type': 'boolean' } -+ }, -+ 'default': {}, -+ 'markdownDescription': nls.localize('filesReadonlyInclude', "Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to mark as read-only. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. You can exclude matching paths via the `#files.readonlyExclude#` setting. Files from readonly file system providers will always be read-only independent of this setting."), -+ 'scope': ConfigurationScope.RESOURCE -+ }, -+ [FILES_READONLY_EXCLUDE_CONFIG]: { -+ 'type': 'object', -+ 'patternProperties': { -+ '.*': { 'type': 'boolean' } -+ }, -+ 'default': {}, -+ 'markdownDescription': nls.localize('filesReadonlyExclude', "Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from being marked as read-only if they match as a result of the `#files.readonlyInclude#` setting. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. Files from readonly file system providers will always be read-only independent of this setting."), -+ 'scope': ConfigurationScope.RESOURCE -+ }, -+ [FILES_READONLY_FROM_PERMISSIONS_CONFIG]: { -+ 'type': 'boolean', -+ 'markdownDescription': nls.localize('filesReadonlyFromPermissions', "Marks files as read-only when their file permissions indicate as such. This can be overridden via `#files.readonlyInclude#` and `#files.readonlyExclude#` settings."), -+ 'default': false -+ }, -+ 'files.restoreUndoStack': { -+ 'type': 'boolean', -+ 'description': nls.localize('files.restoreUndoStack', "Restore the undo stack when a file is reopened."), -+ 'default': true -+ }, -+ 'files.saveConflictResolution': { -+ 'type': 'string', -+ 'enum': [ -+ 'askUser', -+ 'overwriteFileOnDisk' -+ ], -+ 'enumDescriptions': [ -+ nls.localize('askUser', "Will refuse to save and ask for resolving the save conflict manually."), -+ nls.localize('overwriteFileOnDisk', "Will resolve the save conflict by overwriting the file on disk with the changes in the editor.") -+ ], -+ 'description': nls.localize('files.saveConflictResolution', "A save conflict can occur when a file is saved to disk that was changed by another program in the meantime. To prevent data loss, the user is asked to compare the changes in the editor with the version on disk. This setting should only be changed if you frequently encounter save conflict errors and may result in data loss if used without caution."), -+ 'default': 'askUser', -+ 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -+ }, -+ 'files.dialog.defaultPath': { -+ 'type': 'string', -+ 'pattern': '^((\\/|\\\\\\\\|[a-zA-Z]:\\\\).*)?$', // slash OR UNC-root OR drive-root OR undefined -+ 'patternErrorMessage': nls.localize('defaultPathErrorMessage', "Default path for file dialogs must be an absolute path (e.g. C:\\\\myFolder or /myFolder)."), -+ 'description': nls.localize('fileDialogDefaultPath', "Default path for file dialogs, overriding user's home path. Only used in the absence of a context-specific path, such as most recently opened file or folder."), -+ 'scope': ConfigurationScope.MACHINE -+ }, -+ 'files.simpleDialog.enable': { -+ 'type': 'boolean', -+ 'description': nls.localize('files.simpleDialog.enable', "Enables the simple file dialog for opening and saving files and folders. The simple file dialog replaces the system file dialog when enabled."), -+ 'default': false -+ }, -+ 'files.participants.timeout': { -+ type: 'number', -+ default: 60000, -+ markdownDescription: nls.localize('files.participants.timeout', "Timeout in milliseconds after which file participants for create, rename, and delete are cancelled. Use `0` to disable participants."), -+ } -+ } -+}); -+ -+configurationRegistry.registerConfiguration({ -+ ...editorConfigurationBaseNode, -+ properties: { -+ 'editor.formatOnSave': { -+ 'type': 'boolean', -+ 'description': nls.localize('formatOnSave', "Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."), -+ 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE, -+ }, -+ 'editor.formatOnSaveMode': { -+ 'type': 'string', -+ 'default': 'file', -+ 'enum': [ -+ 'file', -+ 'modifications', -+ 'modificationsIfAvailable' -+ ], -+ 'enumDescriptions': [ -+ nls.localize({ key: 'everything', comment: ['This is the description of an option'] }, "Format the whole file."), -+ nls.localize({ key: 'modification', comment: ['This is the description of an option'] }, "Format modifications (requires source control)."), -+ nls.localize({ key: 'modificationIfAvailable', comment: ['This is the description of an option'] }, "Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted."), -+ ], -+ 'markdownDescription': nls.localize('formatOnSaveMode', "Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."), -+ 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE, -+ }, -+ } -+}); -diff --git a/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.ts b/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.ts -new file mode 100644 -index 00000000000..27601da294a ---- /dev/null -+++ b/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.ts -@@ -0,0 +1,93 @@ -+/*--------------------------------------------------------------------------------------------- -+ * Copyright (c) Microsoft Corporation. All rights reserved. -+ * Licensed under the MIT License. See License.txt in the project root for license information. -+ *--------------------------------------------------------------------------------------------*/ -+ -+import { Schemas } from 'vs/base/common/network'; -+import { sep } from 'vs/base/common/path'; -+import { isWindows } from 'vs/base/common/platform'; -+import { ModesRegistry } from 'vs/editor/common/languages/modesRegistry'; -+import * as nls from 'vs/nls'; -+import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -+import { ILabelService } from 'vs/platform/label/common/label'; -+import { Registry } from 'vs/platform/registry/common/platform'; -+import { EditorPaneDescriptor, IEditorPaneRegistry } from 'vs/workbench/browser/editor'; -+import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; -+import { EditorExtensions, IEditorFactoryRegistry } from 'vs/workbench/common/editor'; -+import { BinaryFileEditor } from 'vs/workbench/contrib/files/browser/editors/binaryFileEditor'; -+import { FileEditorInputSerializer, FileEditorWorkingCopyEditorHandler } from 'vs/workbench/contrib/files/browser/editors/fileEditorHandler'; -+import { FileEditorInput } from 'vs/workbench/contrib/files/browser/editors/fileEditorInput'; -+import { TextFileEditor } from 'vs/workbench/contrib/files/browser/editors/textFileEditor'; -+import { TextFileEditorTracker } from 'vs/workbench/contrib/files/browser/editors/textFileEditorTracker'; -+import { TextFileSaveErrorHandler } from 'vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler'; -+import { WorkspaceWatcher } from 'vs/workbench/contrib/files/browser/workspaceWatcher'; -+import { DirtyFilesIndicator } from 'vs/workbench/contrib/files/common/dirtyFilesIndicator'; -+import { BINARY_TEXT_FILE_MODE, FILE_EDITOR_INPUT_ID } from 'vs/workbench/contrib/files/common/files'; -+import './files.contribution._fileEditorFactory'; -+ -+class FileUriLabelContribution implements IWorkbenchContribution { -+ -+ static readonly ID = 'workbench.contrib.fileUriLabel'; -+ -+ constructor(@ILabelService labelService: ILabelService) { -+ labelService.registerFormatter({ -+ scheme: Schemas.file, -+ formatting: { -+ label: '${authority}${path}', -+ separator: sep, -+ tildify: !isWindows, -+ normalizeDriveLetter: isWindows, -+ authorityPrefix: sep + sep, -+ workspaceSuffix: '' -+ } -+ }); -+ } -+} -+// Register file editors -+ -+Registry.as(EditorExtensions.EditorPane).registerEditorPane( -+ EditorPaneDescriptor.create( -+ TextFileEditor, -+ TextFileEditor.ID, -+ nls.localize('textFileEditor', "Text File Editor") -+ ), -+ [ -+ new SyncDescriptor(FileEditorInput) -+ ] -+); -+ -+Registry.as(EditorExtensions.EditorPane).registerEditorPane( -+ EditorPaneDescriptor.create( -+ BinaryFileEditor, -+ BinaryFileEditor.ID, -+ nls.localize('binaryFileEditor', "Binary File Editor") -+ ), -+ [ -+ new SyncDescriptor(FileEditorInput) -+ ] -+); -+ -+// Register Editor Input Serializer & Handler -+Registry.as(EditorExtensions.EditorFactory).registerEditorSerializer(FILE_EDITOR_INPUT_ID, FileEditorInputSerializer); -+registerWorkbenchContribution2(FileEditorWorkingCopyEditorHandler.ID, FileEditorWorkingCopyEditorHandler, WorkbenchPhase.BlockRestore); -+ -+// Register Text File Editor Tracker -+registerWorkbenchContribution2(TextFileEditorTracker.ID, TextFileEditorTracker, WorkbenchPhase.BlockStartup); -+ -+// Register Text File Save Error Handler -+registerWorkbenchContribution2(TextFileSaveErrorHandler.ID, TextFileSaveErrorHandler, WorkbenchPhase.BlockStartup); -+ -+// Register uri display for file uris -+registerWorkbenchContribution2(FileUriLabelContribution.ID, FileUriLabelContribution, WorkbenchPhase.BlockStartup); -+ -+// Register Workspace Watcher -+registerWorkbenchContribution2(WorkspaceWatcher.ID, WorkspaceWatcher, WorkbenchPhase.AfterRestored); -+ -+// Register Dirty Files Indicator -+registerWorkbenchContribution2(DirtyFilesIndicator.ID, DirtyFilesIndicator, WorkbenchPhase.BlockStartup); -+ -+ModesRegistry.registerLanguage({ -+ id: BINARY_TEXT_FILE_MODE, -+ aliases: ['Binary'], -+ mimetypes: ['text/x-code-binary'] -+}); -diff --git a/src/vs/workbench/contrib/files/browser/files.contribution._explorer.ts b/src/vs/workbench/contrib/files/browser/files.contribution._explorer.ts -new file mode 100644 -index 00000000000..6a76fd36387 ---- /dev/null -+++ b/src/vs/workbench/contrib/files/browser/files.contribution._explorer.ts -@@ -0,0 +1,280 @@ -+/*--------------------------------------------------------------------------------------------- -+ * Copyright (c) Microsoft Corporation. All rights reserved. -+ * Licensed under the MIT License. See License.txt in the project root for license information. -+ *--------------------------------------------------------------------------------------------*/ -+ -+import { RedoCommand, UndoCommand } from 'vs/editor/browser/editorExtensions'; -+import * as nls from 'vs/nls'; -+import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -+import { Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -+import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -+import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -+import { Registry } from 'vs/platform/registry/common/platform'; -+import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo'; -+import { WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; -+import { ExplorerService, UNDO_REDO_SOURCE } from 'vs/workbench/contrib/files/browser/explorerService'; -+import { ExplorerViewletViewsContribution } from 'vs/workbench/contrib/files/browser/explorerViewlet'; -+import { IExplorerService } from 'vs/workbench/contrib/files/browser/files'; -+import { IFilesConfiguration, LexicographicOptions, SortOrder, UndoConfirmLevel } from 'vs/workbench/contrib/files/common/files'; -+import './files.contribution._configuration'; -+import './files.contribution._editorPane'; -+import './files.contribution._fileEditorFactory'; -+ -+registerSingleton(IExplorerService, ExplorerService, InstantiationType.Delayed); -+ -+// Register Explorer views -+registerWorkbenchContribution2(ExplorerViewletViewsContribution.ID, ExplorerViewletViewsContribution, WorkbenchPhase.BlockStartup); -+ -+// Configuration -+const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); -+ -+configurationRegistry.registerConfiguration({ -+ 'id': 'explorer', -+ 'order': 10, -+ 'title': nls.localize('explorerConfigurationTitle', "File Explorer"), -+ 'type': 'object', -+ 'properties': { -+ 'explorer.openEditors.visible': { -+ 'type': 'number', -+ 'description': nls.localize({ key: 'openEditorsVisible', comment: ['Open is an adjective'] }, "The initial maximum number of editors shown in the Open Editors pane. Exceeding this limit will show a scroll bar and allow resizing the pane to display more items."), -+ 'default': 9, -+ 'minimum': 1 -+ }, -+ 'explorer.openEditors.minVisible': { -+ 'type': 'number', -+ 'description': nls.localize({ key: 'openEditorsVisibleMin', comment: ['Open is an adjective'] }, "The minimum number of editor slots pre-allocated in the Open Editors pane. If set to 0 the Open Editors pane will dynamically resize based on the number of editors."), -+ 'default': 0, -+ 'minimum': 0 -+ }, -+ 'explorer.openEditors.sortOrder': { -+ 'type': 'string', -+ 'enum': ['editorOrder', 'alphabetical', 'fullPath'], -+ 'description': nls.localize({ key: 'openEditorsSortOrder', comment: ['Open is an adjective'] }, "Controls the sorting order of editors in the Open Editors pane."), -+ 'enumDescriptions': [ -+ nls.localize('sortOrder.editorOrder', 'Editors are ordered in the same order editor tabs are shown.'), -+ nls.localize('sortOrder.alphabetical', 'Editors are ordered alphabetically by tab name inside each editor group.'), -+ nls.localize('sortOrder.fullPath', 'Editors are ordered alphabetically by full path inside each editor group.') -+ ], -+ 'default': 'editorOrder' -+ }, -+ 'explorer.autoReveal': { -+ 'type': ['boolean', 'string'], -+ 'enum': [true, false, 'focusNoScroll'], -+ 'default': true, -+ 'enumDescriptions': [ -+ nls.localize('autoReveal.on', 'Files will be revealed and selected.'), -+ nls.localize('autoReveal.off', 'Files will not be revealed and selected.'), -+ nls.localize('autoReveal.focusNoScroll', 'Files will not be scrolled into view, but will still be focused.'), -+ ], -+ 'description': nls.localize('autoReveal', "Controls whether the Explorer should automatically reveal and select files when opening them.") -+ }, -+ 'explorer.autoRevealExclude': { -+ 'type': 'object', -+ 'markdownDescription': nls.localize('autoRevealExclude', "Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files and folders from being revealed and selected in the Explorer when they are opened. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths."), -+ 'default': { '**/node_modules': true, '**/bower_components': true }, -+ 'additionalProperties': { -+ 'anyOf': [ -+ { -+ 'type': 'boolean', -+ 'description': nls.localize('explorer.autoRevealExclude.boolean', "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern."), -+ }, -+ { -+ type: 'object', -+ properties: { -+ when: { -+ type: 'string', // expression ({ "**/*.js": { "when": "$(basename).js" } }) -+ pattern: '\\w*\\$\\(basename\\)\\w*', -+ default: '$(basename).ext', -+ description: nls.localize('explorer.autoRevealExclude.when', 'Additional check on the siblings of a matching file. Use $(basename) as variable for the matching file name.') -+ } -+ } -+ } -+ ] -+ } -+ }, -+ 'explorer.enableDragAndDrop': { -+ 'type': 'boolean', -+ 'description': nls.localize('enableDragAndDrop', "Controls whether the Explorer should allow to move files and folders via drag and drop. This setting only effects drag and drop from inside the Explorer."), -+ 'default': true -+ }, -+ 'explorer.confirmDragAndDrop': { -+ 'type': 'boolean', -+ 'description': nls.localize('confirmDragAndDrop', "Controls whether the Explorer should ask for confirmation to move files and folders via drag and drop."), -+ 'default': true -+ }, -+ 'explorer.confirmPasteNative': { -+ 'type': 'boolean', -+ 'description': nls.localize('confirmPasteNative', "Controls whether the Explorer should ask for confirmation when pasting native files and folders."), -+ 'default': true -+ }, -+ 'explorer.confirmDelete': { -+ 'type': 'boolean', -+ 'description': nls.localize('confirmDelete', "Controls whether the Explorer should ask for confirmation when deleting a file via the trash."), -+ 'default': true -+ }, -+ 'explorer.enableUndo': { -+ 'type': 'boolean', -+ 'description': nls.localize('enableUndo', "Controls whether the Explorer should support undoing file and folder operations."), -+ 'default': true -+ }, -+ 'explorer.confirmUndo': { -+ 'type': 'string', -+ 'enum': [UndoConfirmLevel.Verbose, UndoConfirmLevel.Default, UndoConfirmLevel.Light], -+ 'description': nls.localize('confirmUndo', "Controls whether the Explorer should ask for confirmation when undoing."), -+ 'default': UndoConfirmLevel.Default, -+ 'enumDescriptions': [ -+ nls.localize('enableUndo.verbose', 'Explorer will prompt before all undo operations.'), -+ nls.localize('enableUndo.default', 'Explorer will prompt before destructive undo operations.'), -+ nls.localize('enableUndo.light', 'Explorer will not prompt before undo operations when focused.'), -+ ], -+ }, -+ 'explorer.expandSingleFolderWorkspaces': { -+ 'type': 'boolean', -+ 'description': nls.localize('expandSingleFolderWorkspaces', "Controls whether the Explorer should expand multi-root workspaces containing only one folder during initialization"), -+ 'default': true -+ }, -+ 'explorer.sortOrder': { -+ 'type': 'string', -+ 'enum': [SortOrder.Default, SortOrder.Mixed, SortOrder.FilesFirst, SortOrder.Type, SortOrder.Modified, SortOrder.FoldersNestsFiles], -+ 'default': SortOrder.Default, -+ 'enumDescriptions': [ -+ nls.localize('sortOrder.default', 'Files and folders are sorted by their names. Folders are displayed before files.'), -+ nls.localize('sortOrder.mixed', 'Files and folders are sorted by their names. Files are interwoven with folders.'), -+ nls.localize('sortOrder.filesFirst', 'Files and folders are sorted by their names. Files are displayed before folders.'), -+ nls.localize('sortOrder.type', 'Files and folders are grouped by extension type then sorted by their names. Folders are displayed before files.'), -+ nls.localize('sortOrder.modified', 'Files and folders are sorted by last modified date in descending order. Folders are displayed before files.'), -+ nls.localize('sortOrder.foldersNestsFiles', 'Files and folders are sorted by their names. Folders are displayed before files. Files with nested children are displayed before other files.') -+ ], -+ 'markdownDescription': nls.localize('sortOrder', "Controls the property-based sorting of files and folders in the Explorer. When `#explorer.fileNesting.enabled#` is enabled, also controls sorting of nested files.") -+ }, -+ 'explorer.sortOrderLexicographicOptions': { -+ 'type': 'string', -+ 'enum': [LexicographicOptions.Default, LexicographicOptions.Upper, LexicographicOptions.Lower, LexicographicOptions.Unicode], -+ 'default': LexicographicOptions.Default, -+ 'enumDescriptions': [ -+ nls.localize('sortOrderLexicographicOptions.default', 'Uppercase and lowercase names are mixed together.'), -+ nls.localize('sortOrderLexicographicOptions.upper', 'Uppercase names are grouped together before lowercase names.'), -+ nls.localize('sortOrderLexicographicOptions.lower', 'Lowercase names are grouped together before uppercase names.'), -+ nls.localize('sortOrderLexicographicOptions.unicode', 'Names are sorted in Unicode order.') -+ ], -+ 'description': nls.localize('sortOrderLexicographicOptions', "Controls the lexicographic sorting of file and folder names in the Explorer.") -+ }, -+ 'explorer.sortOrderReverse': { -+ 'type': 'boolean', -+ 'description': nls.localize('sortOrderReverse', "Controls whether the file and folder sort order, should be reversed."), -+ 'default': false, -+ }, -+ 'explorer.decorations.colors': { -+ type: 'boolean', -+ description: nls.localize('explorer.decorations.colors', "Controls whether file decorations should use colors."), -+ default: true -+ }, -+ 'explorer.decorations.badges': { -+ type: 'boolean', -+ description: nls.localize('explorer.decorations.badges', "Controls whether file decorations should use badges."), -+ default: true -+ }, -+ 'explorer.incrementalNaming': { -+ 'type': 'string', -+ enum: ['simple', 'smart', 'disabled'], -+ enumDescriptions: [ -+ nls.localize('simple', "Appends the word \"copy\" at the end of the duplicated name potentially followed by a number."), -+ nls.localize('smart', "Adds a number at the end of the duplicated name. If some number is already part of the name, tries to increase that number."), -+ nls.localize('disabled', "Disables incremental naming. If two files with the same name exist you will be prompted to overwrite the existing file.") -+ ], -+ description: nls.localize('explorer.incrementalNaming', "Controls which naming strategy to use when giving a new name to a duplicated Explorer item on paste."), -+ default: 'simple' -+ }, -+ 'explorer.autoOpenDroppedFile': { -+ 'type': 'boolean', -+ 'description': nls.localize('autoOpenDroppedFile', "Controls whether the Explorer should automatically open a file when it is dropped into the explorer"), -+ 'default': true -+ }, -+ 'explorer.compactFolders': { -+ 'type': 'boolean', -+ 'description': nls.localize('compressSingleChildFolders', "Controls whether the Explorer should render folders in a compact form. In such a form, single child folders will be compressed in a combined tree element. Useful for Java package structures, for example."), -+ 'default': true -+ }, -+ 'explorer.copyRelativePathSeparator': { -+ 'type': 'string', -+ 'enum': [ -+ '/', -+ '\\', -+ 'auto' -+ ], -+ 'enumDescriptions': [ -+ nls.localize('copyRelativePathSeparator.slash', "Use slash as path separation character."), -+ nls.localize('copyRelativePathSeparator.backslash', "Use backslash as path separation character."), -+ nls.localize('copyRelativePathSeparator.auto', "Uses operating system specific path separation character."), -+ ], -+ 'description': nls.localize('copyRelativePathSeparator', "The path separation character used when copying relative file paths."), -+ 'default': 'auto' -+ }, -+ 'explorer.excludeGitIgnore': { -+ type: 'boolean', -+ markdownDescription: nls.localize('excludeGitignore', "Controls whether entries in .gitignore should be parsed and excluded from the Explorer. Similar to {0}.", '`#files.exclude#`'), -+ default: false, -+ scope: ConfigurationScope.RESOURCE -+ }, -+ 'explorer.fileNesting.enabled': { -+ 'type': 'boolean', -+ scope: ConfigurationScope.RESOURCE, -+ 'markdownDescription': nls.localize('fileNestingEnabled', "Controls whether file nesting is enabled in the Explorer. File nesting allows for related files in a directory to be visually grouped together under a single parent file."), -+ 'default': false, -+ }, -+ 'explorer.fileNesting.expand': { -+ 'type': 'boolean', -+ 'markdownDescription': nls.localize('fileNestingExpand', "Controls whether file nests are automatically expanded. {0} must be set for this to take effect.", '`#explorer.fileNesting.enabled#`'), -+ 'default': true, -+ }, -+ 'explorer.fileNesting.patterns': { -+ 'type': 'object', -+ scope: ConfigurationScope.RESOURCE, -+ 'markdownDescription': nls.localize('fileNestingPatterns', "Controls nesting of files in the Explorer. {0} must be set for this to take effect. Each __Item__ represents a parent pattern and may contain a single `*` character that matches any string. Each __Value__ represents a comma separated list of the child patterns that should be shown nested under a given parent. Child patterns may contain several special tokens:\n- `${capture}`: Matches the resolved value of the `*` from the parent pattern\n- `${basename}`: Matches the parent file's basename, the `file` in `file.ts`\n- `${extname}`: Matches the parent file's extension, the `ts` in `file.ts`\n- `${dirname}`: Matches the parent file's directory name, the `src` in `src/file.ts`\n- `*`: Matches any string, may only be used once per child pattern", '`#explorer.fileNesting.enabled#`'), -+ patternProperties: { -+ '^[^*]*\\*?[^*]*$': { -+ markdownDescription: nls.localize('fileNesting.description', "Each key pattern may contain a single `*` character which will match any string."), -+ type: 'string', -+ pattern: '^([^,*]*\\*?[^,*]*)(, ?[^,*]*\\*?[^,*]*)*$', -+ } -+ }, -+ additionalProperties: false, -+ 'default': { -+ '*.ts': '${capture}.js', -+ '*.js': '${capture}.js.map, ${capture}.min.js, ${capture}.d.ts', -+ '*.jsx': '${capture}.js', -+ '*.tsx': '${capture}.ts', -+ 'tsconfig.json': 'tsconfig.*.json', -+ 'package.json': 'package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb', -+ } -+ } -+ } -+}); -+ -+UndoCommand.addImplementation(110, 'explorer', (accessor: ServicesAccessor) => { -+ const undoRedoService = accessor.get(IUndoRedoService); -+ const explorerService = accessor.get(IExplorerService); -+ const configurationService = accessor.get(IConfigurationService); -+ -+ const explorerCanUndo = configurationService.getValue().explorer.enableUndo; -+ if (explorerService.hasViewFocus() && undoRedoService.canUndo(UNDO_REDO_SOURCE) && explorerCanUndo) { -+ undoRedoService.undo(UNDO_REDO_SOURCE); -+ return true; -+ } -+ -+ return false; -+}); -+ -+RedoCommand.addImplementation(110, 'explorer', (accessor: ServicesAccessor) => { -+ const undoRedoService = accessor.get(IUndoRedoService); -+ const explorerService = accessor.get(IExplorerService); -+ const configurationService = accessor.get(IConfigurationService); -+ -+ const explorerCanUndo = configurationService.getValue().explorer.enableUndo; -+ if (explorerService.hasViewFocus() && undoRedoService.canRedo(UNDO_REDO_SOURCE) && explorerCanUndo) { -+ undoRedoService.redo(UNDO_REDO_SOURCE); -+ return true; -+ } -+ -+ return false; -+}); -diff --git a/src/vs/workbench/contrib/files/browser/files.contribution._fileEditorFactory.ts b/src/vs/workbench/contrib/files/browser/files.contribution._fileEditorFactory.ts -new file mode 100644 -index 00000000000..2f31d6a7984 ---- /dev/null -+++ b/src/vs/workbench/contrib/files/browser/files.contribution._fileEditorFactory.ts -@@ -0,0 +1,23 @@ -+/*--------------------------------------------------------------------------------------------- -+ * Copyright (c) Microsoft Corporation. All rights reserved. -+ * Licensed under the MIT License. See License.txt in the project root for license information. -+ *--------------------------------------------------------------------------------------------*/ -+ -+import { Registry } from 'vs/platform/registry/common/platform'; -+import { EditorExtensions, IEditorFactoryRegistry, IFileEditorInput } from 'vs/workbench/common/editor'; -+import { FileEditorInput } from 'vs/workbench/contrib/files/browser/editors/fileEditorInput'; -+import { FILE_EDITOR_INPUT_ID } from 'vs/workbench/contrib/files/common/files'; -+ -+// Register default file input factory -+Registry.as(EditorExtensions.EditorFactory).registerFileEditorFactory({ -+ -+ typeId: FILE_EDITOR_INPUT_ID, -+ -+ createFileEditor: (resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents, instantiationService): IFileEditorInput => { -+ return instantiationService.createInstance(FileEditorInput, resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents); -+ }, -+ -+ isFileEditor: (obj): obj is IFileEditorInput => { -+ return obj instanceof FileEditorInput; -+ } -+}); -diff --git a/src/vs/workbench/contrib/files/browser/files.contribution.ts b/src/vs/workbench/contrib/files/browser/files.contribution.ts -index 250bb0c060a..269fb34cadb 100644 ---- a/src/vs/workbench/contrib/files/browser/files.contribution.ts -+++ b/src/vs/workbench/contrib/files/browser/files.contribution.ts -@@ -3,658 +3,7 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - --import * as nls from '../../../../nls.js'; --import { sep } from '../../../../base/common/path.js'; --import { Registry } from '../../../../platform/registry/common/platform.js'; --import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationPropertySchema } from '../../../../platform/configuration/common/configurationRegistry.js'; --import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from '../../../common/contributions.js'; --import { IFileEditorInput, IEditorFactoryRegistry, EditorExtensions } from '../../../common/editor.js'; --import { AutoSaveConfiguration, HotExitConfiguration, FILES_EXCLUDE_CONFIG, FILES_ASSOCIATIONS_CONFIG, FILES_READONLY_INCLUDE_CONFIG, FILES_READONLY_EXCLUDE_CONFIG, FILES_READONLY_FROM_PERMISSIONS_CONFIG } from '../../../../platform/files/common/files.js'; --import { SortOrder, LexicographicOptions, FILE_EDITOR_INPUT_ID, BINARY_TEXT_FILE_MODE, UndoConfirmLevel, IFilesConfiguration } from '../common/files.js'; --import { TextFileEditorTracker } from './editors/textFileEditorTracker.js'; --import { TextFileSaveErrorHandler } from './editors/textFileSaveErrorHandler.js'; --import { FileEditorInput } from './editors/fileEditorInput.js'; --import { BinaryFileEditor } from './editors/binaryFileEditor.js'; --import { ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; --import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js'; --import { isNative, isWeb, isWindows } from '../../../../base/common/platform.js'; --import { ExplorerViewletViewsContribution } from './explorerViewlet.js'; --import { IEditorPaneRegistry, EditorPaneDescriptor } from '../../../browser/editor.js'; --import { ILabelService } from '../../../../platform/label/common/label.js'; --import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; --import { ExplorerService, UNDO_REDO_SOURCE } from './explorerService.js'; --import { GUESSABLE_ENCODINGS, SUPPORTED_ENCODINGS } from '../../../services/textfile/common/encoding.js'; --import { Schemas } from '../../../../base/common/network.js'; --import { WorkspaceWatcher } from './workspaceWatcher.js'; --import { editorConfigurationBaseNode } from '../../../../editor/common/config/editorConfigurationSchema.js'; --import { DirtyFilesIndicator } from '../common/dirtyFilesIndicator.js'; --import { UndoCommand, RedoCommand } from '../../../../editor/browser/editorExtensions.js'; --import { IUndoRedoService } from '../../../../platform/undoRedo/common/undoRedo.js'; --import { IExplorerService } from './files.js'; --import { FileEditorInputSerializer, FileEditorWorkingCopyEditorHandler } from './editors/fileEditorHandler.js'; --import { ModesRegistry } from '../../../../editor/common/languages/modesRegistry.js'; --import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; --import { TextFileEditor } from './editors/textFileEditor.js'; -- --class FileUriLabelContribution implements IWorkbenchContribution { -- -- static readonly ID = 'workbench.contrib.fileUriLabel'; -- -- constructor(@ILabelService labelService: ILabelService) { -- labelService.registerFormatter({ -- scheme: Schemas.file, -- formatting: { -- label: '${authority}${path}', -- separator: sep, -- tildify: !isWindows, -- normalizeDriveLetter: isWindows, -- authorityPrefix: sep + sep, -- workspaceSuffix: '' -- } -- }); -- } --} -- --registerSingleton(IExplorerService, ExplorerService, InstantiationType.Delayed); -- --// Register file editors -- --Registry.as(EditorExtensions.EditorPane).registerEditorPane( -- EditorPaneDescriptor.create( -- TextFileEditor, -- TextFileEditor.ID, -- nls.localize('textFileEditor', "Text File Editor") -- ), -- [ -- new SyncDescriptor(FileEditorInput) -- ] --); -- --Registry.as(EditorExtensions.EditorPane).registerEditorPane( -- EditorPaneDescriptor.create( -- BinaryFileEditor, -- BinaryFileEditor.ID, -- nls.localize('binaryFileEditor', "Binary File Editor") -- ), -- [ -- new SyncDescriptor(FileEditorInput) -- ] --); -- --// Register default file input factory --Registry.as(EditorExtensions.EditorFactory).registerFileEditorFactory({ -- -- typeId: FILE_EDITOR_INPUT_ID, -- -- createFileEditor: (resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents, instantiationService): IFileEditorInput => { -- return instantiationService.createInstance(FileEditorInput, resource, preferredResource, preferredName, preferredDescription, preferredEncoding, preferredLanguageId, preferredContents); -- }, -- -- isFileEditor: (obj): obj is IFileEditorInput => { -- return obj instanceof FileEditorInput; -- } --}); -- --// Register Editor Input Serializer & Handler --Registry.as(EditorExtensions.EditorFactory).registerEditorSerializer(FILE_EDITOR_INPUT_ID, FileEditorInputSerializer); --registerWorkbenchContribution2(FileEditorWorkingCopyEditorHandler.ID, FileEditorWorkingCopyEditorHandler, WorkbenchPhase.BlockRestore); -- --// Register Explorer views --registerWorkbenchContribution2(ExplorerViewletViewsContribution.ID, ExplorerViewletViewsContribution, WorkbenchPhase.BlockStartup); -- --// Register Text File Editor Tracker --registerWorkbenchContribution2(TextFileEditorTracker.ID, TextFileEditorTracker, WorkbenchPhase.BlockStartup); -- --// Register Text File Save Error Handler --registerWorkbenchContribution2(TextFileSaveErrorHandler.ID, TextFileSaveErrorHandler, WorkbenchPhase.BlockStartup); -- --// Register uri display for file uris --registerWorkbenchContribution2(FileUriLabelContribution.ID, FileUriLabelContribution, WorkbenchPhase.BlockStartup); -- --// Register Workspace Watcher --registerWorkbenchContribution2(WorkspaceWatcher.ID, WorkspaceWatcher, WorkbenchPhase.AfterRestored); -- --// Register Dirty Files Indicator --registerWorkbenchContribution2(DirtyFilesIndicator.ID, DirtyFilesIndicator, WorkbenchPhase.BlockStartup); -- --// Configuration --const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration); -- --const hotExitConfiguration: IConfigurationPropertySchema = isNative ? -- { -- 'type': 'string', -- 'scope': ConfigurationScope.APPLICATION, -- 'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE], -- 'default': HotExitConfiguration.ON_EXIT, -- 'markdownEnumDescriptions': [ -- nls.localize('hotExit.off', 'Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes.'), -- nls.localize('hotExit.onExit', 'Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu). All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`'), -- nls.localize('hotExit.onExitAndWindowClose', 'Hot exit will be triggered when the last window is closed on Windows/Linux or when the `workbench.action.quit` command is triggered (command palette, keybinding, menu), and also for any window with a folder opened regardless of whether it\'s the last window. All windows without folders opened will be restored upon next launch. A list of previously opened windows with unsaved files can be accessed via `File > Open Recent > More...`') -- ], -- 'markdownDescription': nls.localize('hotExit', "[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.", HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) -- } : { -- 'type': 'string', -- 'scope': ConfigurationScope.APPLICATION, -- 'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE], -- 'default': HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE, -- 'markdownEnumDescriptions': [ -- nls.localize('hotExit.off', 'Disable hot exit. A prompt will show when attempting to close a window with editors that have unsaved changes.'), -- nls.localize('hotExit.onExitAndWindowCloseBrowser', 'Hot exit will be triggered when the browser quits or the window or tab is closed.') -- ], -- 'markdownDescription': nls.localize('hotExit', "[Hot Exit](https://aka.ms/vscode-hot-exit) controls whether unsaved files are remembered between sessions, allowing the save prompt when exiting the editor to be skipped.", HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) -- }; -- --configurationRegistry.registerConfiguration({ -- 'id': 'files', -- 'order': 9, -- 'title': nls.localize('filesConfigurationTitle', "Files"), -- 'type': 'object', -- 'properties': { -- [FILES_EXCLUDE_CONFIG]: { -- 'type': 'object', -- 'markdownDescription': nls.localize('exclude', "Configure [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files and folders. For example, the File Explorer decides which files and folders to show or hide based on this setting. Refer to the `#search.exclude#` setting to define search-specific excludes. Refer to the `#explorer.excludeGitIgnore#` setting for ignoring files based on your `.gitignore`."), -- 'default': { -- ...{ '**/.git': true, '**/.svn': true, '**/.hg': true, '**/CVS': true, '**/.DS_Store': true, '**/Thumbs.db': true }, -- ...(isWeb ? { '**/*.crswap': true /* filter out swap files used for local file access */ } : undefined) -- }, -- 'scope': ConfigurationScope.RESOURCE, -- 'additionalProperties': { -- 'anyOf': [ -- { -- 'type': 'boolean', -- 'enum': [true, false], -- 'enumDescriptions': [nls.localize('trueDescription', "Enable the pattern."), nls.localize('falseDescription', "Disable the pattern.")], -- 'description': nls.localize('files.exclude.boolean', "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern."), -- }, -- { -- 'type': 'object', -- 'properties': { -- 'when': { -- 'type': 'string', // expression ({ "**/*.js": { "when": "$(basename).js" } }) -- 'pattern': '\\w*\\$\\(basename\\)\\w*', -- 'default': '$(basename).ext', -- 'markdownDescription': nls.localize({ key: 'files.exclude.when', comment: ['\\$(basename) should not be translated'] }, "Additional check on the siblings of a matching file. Use \\$(basename) as variable for the matching file name.") -- } -- } -- } -- ] -- } -- }, -- [FILES_ASSOCIATIONS_CONFIG]: { -- 'type': 'object', -- 'markdownDescription': nls.localize('associations', "Configure [glob patterns](https://aka.ms/vscode-glob-patterns) of file associations to languages (for example `\"*.extension\": \"html\"`). Patterns will match on the absolute path of a file if they contain a path separator and will match on the name of the file otherwise. These have precedence over the default associations of the languages installed."), -- 'additionalProperties': { -- 'type': 'string' -- } -- }, -- 'files.encoding': { -- 'type': 'string', -- 'enum': Object.keys(SUPPORTED_ENCODINGS), -- 'default': 'utf8', -- 'description': nls.localize('encoding', "The default character set encoding to use when reading and writing files. This setting can also be configured per language."), -- 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE, -- 'enumDescriptions': Object.keys(SUPPORTED_ENCODINGS).map(key => SUPPORTED_ENCODINGS[key].labelLong), -- 'enumItemLabels': Object.keys(SUPPORTED_ENCODINGS).map(key => SUPPORTED_ENCODINGS[key].labelLong) -- }, -- 'files.autoGuessEncoding': { -- 'type': 'boolean', -- 'default': false, -- 'markdownDescription': nls.localize('autoGuessEncoding', "When enabled, the editor will attempt to guess the character set encoding when opening files. This setting can also be configured per language. Note, this setting is not respected by text search. Only {0} is respected.", '`#files.encoding#`'), -- 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -- }, -- 'files.candidateGuessEncodings': { -- 'type': 'array', -- 'items': { -- 'type': 'string', -- 'enum': Object.keys(GUESSABLE_ENCODINGS), -- 'enumDescriptions': Object.keys(GUESSABLE_ENCODINGS).map(key => GUESSABLE_ENCODINGS[key].labelLong) -- }, -- 'default': [], -- 'markdownDescription': nls.localize('candidateGuessEncodings', "List of character set encodings that the editor should attempt to guess in the order they are listed. In case it cannot be determined, {0} is respected", '`#files.encoding#`'), -- 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -- }, -- 'files.eol': { -- 'type': 'string', -- 'enum': [ -- '\n', -- '\r\n', -- 'auto' -- ], -- 'enumDescriptions': [ -- nls.localize('eol.LF', "LF"), -- nls.localize('eol.CRLF', "CRLF"), -- nls.localize('eol.auto', "Uses operating system specific end of line character.") -- ], -- 'default': 'auto', -- 'description': nls.localize('eol', "The default end of line character."), -- 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -- }, -- 'files.enableTrash': { -- 'type': 'boolean', -- 'default': true, -- 'description': nls.localize('useTrash', "Moves files/folders to the OS trash (recycle bin on Windows) when deleting. Disabling this will delete files/folders permanently.") -- }, -- 'files.trimTrailingWhitespace': { -- 'type': 'boolean', -- 'default': false, -- 'description': nls.localize('trimTrailingWhitespace', "When enabled, will trim trailing whitespace when saving a file."), -- 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -- }, -- 'files.trimTrailingWhitespaceInRegexAndStrings': { -- 'type': 'boolean', -- 'default': true, -- 'description': nls.localize('trimTrailingWhitespaceInRegexAndStrings', "When enabled, trailing whitespace will be removed from multiline strings and regexes will be removed on save or when executing 'editor.action.trimTrailingWhitespace'. This can cause whitespace to not be trimmed from lines when there isn't up-to-date token information."), -- 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -- }, -- 'files.insertFinalNewline': { -- 'type': 'boolean', -- 'default': false, -- 'description': nls.localize('insertFinalNewline', "When enabled, insert a final new line at the end of the file when saving it."), -- 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -- }, -- 'files.trimFinalNewlines': { -- 'type': 'boolean', -- 'default': false, -- 'description': nls.localize('trimFinalNewlines', "When enabled, will trim all new lines after the final new line at the end of the file when saving it."), -- scope: ConfigurationScope.LANGUAGE_OVERRIDABLE, -- }, -- 'files.autoSave': { -- 'type': 'string', -- 'enum': [AutoSaveConfiguration.OFF, AutoSaveConfiguration.AFTER_DELAY, AutoSaveConfiguration.ON_FOCUS_CHANGE, AutoSaveConfiguration.ON_WINDOW_CHANGE], -- 'markdownEnumDescriptions': [ -- nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.off' }, "An editor with changes is never automatically saved."), -- nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.afterDelay' }, "An editor with changes is automatically saved after the configured `#files.autoSaveDelay#`."), -- nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.onFocusChange' }, "An editor with changes is automatically saved when the editor loses focus."), -- nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'files.autoSave.onWindowChange' }, "An editor with changes is automatically saved when the window loses focus.") -- ], -- 'default': isWeb ? AutoSaveConfiguration.AFTER_DELAY : AutoSaveConfiguration.OFF, -- 'markdownDescription': nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'autoSave' }, "Controls [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors that have unsaved changes.", AutoSaveConfiguration.OFF, AutoSaveConfiguration.AFTER_DELAY, AutoSaveConfiguration.ON_FOCUS_CHANGE, AutoSaveConfiguration.ON_WINDOW_CHANGE, AutoSaveConfiguration.AFTER_DELAY), -- scope: ConfigurationScope.LANGUAGE_OVERRIDABLE -- }, -- 'files.autoSaveDelay': { -- 'type': 'number', -- 'default': 1000, -- 'minimum': 0, -- 'markdownDescription': nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'autoSaveDelay' }, "Controls the delay in milliseconds after which an editor with unsaved changes is saved automatically. Only applies when `#files.autoSave#` is set to `{0}`.", AutoSaveConfiguration.AFTER_DELAY), -- scope: ConfigurationScope.LANGUAGE_OVERRIDABLE -- }, -- 'files.autoSaveWorkspaceFilesOnly': { -- 'type': 'boolean', -- 'default': false, -- 'markdownDescription': nls.localize('autoSaveWorkspaceFilesOnly', "When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that are inside the opened workspace. Only applies when {0} is enabled.", '`#files.autoSave#`'), -- scope: ConfigurationScope.LANGUAGE_OVERRIDABLE -- }, -- 'files.autoSaveWhenNoErrors': { -- 'type': 'boolean', -- 'default': false, -- 'markdownDescription': nls.localize('autoSaveWhenNoErrors', "When enabled, will limit [auto save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) of editors to files that have no errors reported in them at the time the auto save is triggered. Only applies when {0} is enabled.", '`#files.autoSave#`'), -- scope: ConfigurationScope.LANGUAGE_OVERRIDABLE -- }, -- 'files.watcherExclude': { -- 'type': 'object', -- 'patternProperties': { -- '.*': { 'type': 'boolean' } -- }, -- 'default': { '**/.git/objects/**': true, '**/.git/subtree-cache/**': true, '**/.hg/store/**': true }, -- 'markdownDescription': nls.localize('watcherExclude', "Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from file watching. Paths can either be relative to the watched folder or absolute. Glob patterns are matched relative from the watched folder. When you experience the file watcher process consuming a lot of CPU, make sure to exclude large folders that are of less interest (such as build output folders)."), -- 'scope': ConfigurationScope.RESOURCE -- }, -- 'files.watcherInclude': { -- 'type': 'array', -- 'items': { -- 'type': 'string' -- }, -- 'default': [], -- 'description': nls.localize('watcherInclude', "Configure extra paths to watch for changes inside the workspace. By default, all workspace folders will be watched recursively, except for folders that are symbolic links. You can explicitly add absolute or relative paths to support watching folders that are symbolic links. Relative paths will be resolved to an absolute path using the currently opened workspace."), -- 'scope': ConfigurationScope.RESOURCE -- }, -- 'files.hotExit': hotExitConfiguration, -- 'files.defaultLanguage': { -- 'type': 'string', -- 'markdownDescription': nls.localize('defaultLanguage', "The default language identifier that is assigned to new files. If configured to `${activeEditorLanguage}`, will use the language identifier of the currently active text editor if any.") -- }, -- [FILES_READONLY_INCLUDE_CONFIG]: { -- 'type': 'object', -- 'patternProperties': { -- '.*': { 'type': 'boolean' } -- }, -- 'default': {}, -- 'markdownDescription': nls.localize('filesReadonlyInclude', "Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to mark as read-only. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. You can exclude matching paths via the `#files.readonlyExclude#` setting. Files from readonly file system providers will always be read-only independent of this setting."), -- 'scope': ConfigurationScope.RESOURCE -- }, -- [FILES_READONLY_EXCLUDE_CONFIG]: { -- 'type': 'object', -- 'patternProperties': { -- '.*': { 'type': 'boolean' } -- }, -- 'default': {}, -- 'markdownDescription': nls.localize('filesReadonlyExclude', "Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) to exclude from being marked as read-only if they match as a result of the `#files.readonlyInclude#` setting. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths. Files from readonly file system providers will always be read-only independent of this setting."), -- 'scope': ConfigurationScope.RESOURCE -- }, -- [FILES_READONLY_FROM_PERMISSIONS_CONFIG]: { -- 'type': 'boolean', -- 'markdownDescription': nls.localize('filesReadonlyFromPermissions', "Marks files as read-only when their file permissions indicate as such. This can be overridden via `#files.readonlyInclude#` and `#files.readonlyExclude#` settings."), -- 'default': false -- }, -- 'files.restoreUndoStack': { -- 'type': 'boolean', -- 'description': nls.localize('files.restoreUndoStack', "Restore the undo stack when a file is reopened."), -- 'default': true -- }, -- 'files.saveConflictResolution': { -- 'type': 'string', -- 'enum': [ -- 'askUser', -- 'overwriteFileOnDisk' -- ], -- 'enumDescriptions': [ -- nls.localize('askUser', "Will refuse to save and ask for resolving the save conflict manually."), -- nls.localize('overwriteFileOnDisk', "Will resolve the save conflict by overwriting the file on disk with the changes in the editor.") -- ], -- 'description': nls.localize('files.saveConflictResolution', "A save conflict can occur when a file is saved to disk that was changed by another program in the meantime. To prevent data loss, the user is asked to compare the changes in the editor with the version on disk. This setting should only be changed if you frequently encounter save conflict errors and may result in data loss if used without caution."), -- 'default': 'askUser', -- 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE -- }, -- 'files.dialog.defaultPath': { -- 'type': 'string', -- 'pattern': '^((\\/|\\\\\\\\|[a-zA-Z]:\\\\).*)?$', // slash OR UNC-root OR drive-root OR undefined -- 'patternErrorMessage': nls.localize('defaultPathErrorMessage', "Default path for file dialogs must be an absolute path (e.g. C:\\\\myFolder or /myFolder)."), -- 'description': nls.localize('fileDialogDefaultPath', "Default path for file dialogs, overriding user's home path. Only used in the absence of a context-specific path, such as most recently opened file or folder."), -- 'scope': ConfigurationScope.MACHINE -- }, -- 'files.simpleDialog.enable': { -- 'type': 'boolean', -- 'description': nls.localize('files.simpleDialog.enable', "Enables the simple file dialog for opening and saving files and folders. The simple file dialog replaces the system file dialog when enabled."), -- 'default': false -- }, -- 'files.participants.timeout': { -- type: 'number', -- default: 60000, -- markdownDescription: nls.localize('files.participants.timeout', "Timeout in milliseconds after which file participants for create, rename, and delete are cancelled. Use `0` to disable participants."), -- } -- } --}); -- --configurationRegistry.registerConfiguration({ -- ...editorConfigurationBaseNode, -- properties: { -- 'editor.formatOnSave': { -- 'type': 'boolean', -- 'description': nls.localize('formatOnSave', "Format a file on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."), -- 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE, -- }, -- 'editor.formatOnSaveMode': { -- 'type': 'string', -- 'default': 'file', -- 'enum': [ -- 'file', -- 'modifications', -- 'modificationsIfAvailable' -- ], -- 'enumDescriptions': [ -- nls.localize({ key: 'everything', comment: ['This is the description of an option'] }, "Format the whole file."), -- nls.localize({ key: 'modification', comment: ['This is the description of an option'] }, "Format modifications (requires source control)."), -- nls.localize({ key: 'modificationIfAvailable', comment: ['This is the description of an option'] }, "Will attempt to format modifications only (requires source control). If source control can't be used, then the whole file will be formatted."), -- ], -- 'markdownDescription': nls.localize('formatOnSaveMode', "Controls if format on save formats the whole file or only modifications. Only applies when `#editor.formatOnSave#` is enabled."), -- 'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE, -- }, -- } --}); -- --configurationRegistry.registerConfiguration({ -- 'id': 'explorer', -- 'order': 10, -- 'title': nls.localize('explorerConfigurationTitle', "File Explorer"), -- 'type': 'object', -- 'properties': { -- 'explorer.openEditors.visible': { -- 'type': 'number', -- 'description': nls.localize({ key: 'openEditorsVisible', comment: ['Open is an adjective'] }, "The initial maximum number of editors shown in the Open Editors pane. Exceeding this limit will show a scroll bar and allow resizing the pane to display more items."), -- 'default': 9, -- 'minimum': 1 -- }, -- 'explorer.openEditors.minVisible': { -- 'type': 'number', -- 'description': nls.localize({ key: 'openEditorsVisibleMin', comment: ['Open is an adjective'] }, "The minimum number of editor slots pre-allocated in the Open Editors pane. If set to 0 the Open Editors pane will dynamically resize based on the number of editors."), -- 'default': 0, -- 'minimum': 0 -- }, -- 'explorer.openEditors.sortOrder': { -- 'type': 'string', -- 'enum': ['editorOrder', 'alphabetical', 'fullPath'], -- 'description': nls.localize({ key: 'openEditorsSortOrder', comment: ['Open is an adjective'] }, "Controls the sorting order of editors in the Open Editors pane."), -- 'enumDescriptions': [ -- nls.localize('sortOrder.editorOrder', 'Editors are ordered in the same order editor tabs are shown.'), -- nls.localize('sortOrder.alphabetical', 'Editors are ordered alphabetically by tab name inside each editor group.'), -- nls.localize('sortOrder.fullPath', 'Editors are ordered alphabetically by full path inside each editor group.') -- ], -- 'default': 'editorOrder' -- }, -- 'explorer.autoReveal': { -- 'type': ['boolean', 'string'], -- 'enum': [true, false, 'focusNoScroll'], -- 'default': true, -- 'enumDescriptions': [ -- nls.localize('autoReveal.on', 'Files will be revealed and selected.'), -- nls.localize('autoReveal.off', 'Files will not be revealed and selected.'), -- nls.localize('autoReveal.focusNoScroll', 'Files will not be scrolled into view, but will still be focused.'), -- ], -- 'description': nls.localize('autoReveal', "Controls whether the Explorer should automatically reveal and select files when opening them.") -- }, -- 'explorer.autoRevealExclude': { -- 'type': 'object', -- 'markdownDescription': nls.localize('autoRevealExclude', "Configure paths or [glob patterns](https://aka.ms/vscode-glob-patterns) for excluding files and folders from being revealed and selected in the Explorer when they are opened. Glob patterns are always evaluated relative to the path of the workspace folder unless they are absolute paths."), -- 'default': { '**/node_modules': true, '**/bower_components': true }, -- 'additionalProperties': { -- 'anyOf': [ -- { -- 'type': 'boolean', -- 'description': nls.localize('explorer.autoRevealExclude.boolean', "The glob pattern to match file paths against. Set to true or false to enable or disable the pattern."), -- }, -- { -- type: 'object', -- properties: { -- when: { -- type: 'string', // expression ({ "**/*.js": { "when": "$(basename).js" } }) -- pattern: '\\w*\\$\\(basename\\)\\w*', -- default: '$(basename).ext', -- description: nls.localize('explorer.autoRevealExclude.when', 'Additional check on the siblings of a matching file. Use $(basename) as variable for the matching file name.') -- } -- } -- } -- ] -- } -- }, -- 'explorer.enableDragAndDrop': { -- 'type': 'boolean', -- 'description': nls.localize('enableDragAndDrop', "Controls whether the Explorer should allow to move files and folders via drag and drop. This setting only effects drag and drop from inside the Explorer."), -- 'default': true -- }, -- 'explorer.confirmDragAndDrop': { -- 'type': 'boolean', -- 'description': nls.localize('confirmDragAndDrop', "Controls whether the Explorer should ask for confirmation to move files and folders via drag and drop."), -- 'default': true -- }, -- 'explorer.confirmPasteNative': { -- 'type': 'boolean', -- 'description': nls.localize('confirmPasteNative', "Controls whether the Explorer should ask for confirmation when pasting native files and folders."), -- 'default': true -- }, -- 'explorer.confirmDelete': { -- 'type': 'boolean', -- 'description': nls.localize('confirmDelete', "Controls whether the Explorer should ask for confirmation when deleting a file via the trash."), -- 'default': true -- }, -- 'explorer.enableUndo': { -- 'type': 'boolean', -- 'description': nls.localize('enableUndo', "Controls whether the Explorer should support undoing file and folder operations."), -- 'default': true -- }, -- 'explorer.confirmUndo': { -- 'type': 'string', -- 'enum': [UndoConfirmLevel.Verbose, UndoConfirmLevel.Default, UndoConfirmLevel.Light], -- 'description': nls.localize('confirmUndo', "Controls whether the Explorer should ask for confirmation when undoing."), -- 'default': UndoConfirmLevel.Default, -- 'enumDescriptions': [ -- nls.localize('enableUndo.verbose', 'Explorer will prompt before all undo operations.'), -- nls.localize('enableUndo.default', 'Explorer will prompt before destructive undo operations.'), -- nls.localize('enableUndo.light', 'Explorer will not prompt before undo operations when focused.'), -- ], -- }, -- 'explorer.expandSingleFolderWorkspaces': { -- 'type': 'boolean', -- 'description': nls.localize('expandSingleFolderWorkspaces', "Controls whether the Explorer should expand multi-root workspaces containing only one folder during initialization"), -- 'default': true -- }, -- 'explorer.sortOrder': { -- 'type': 'string', -- 'enum': [SortOrder.Default, SortOrder.Mixed, SortOrder.FilesFirst, SortOrder.Type, SortOrder.Modified, SortOrder.FoldersNestsFiles], -- 'default': SortOrder.Default, -- 'enumDescriptions': [ -- nls.localize('sortOrder.default', 'Files and folders are sorted by their names. Folders are displayed before files.'), -- nls.localize('sortOrder.mixed', 'Files and folders are sorted by their names. Files are interwoven with folders.'), -- nls.localize('sortOrder.filesFirst', 'Files and folders are sorted by their names. Files are displayed before folders.'), -- nls.localize('sortOrder.type', 'Files and folders are grouped by extension type then sorted by their names. Folders are displayed before files.'), -- nls.localize('sortOrder.modified', 'Files and folders are sorted by last modified date in descending order. Folders are displayed before files.'), -- nls.localize('sortOrder.foldersNestsFiles', 'Files and folders are sorted by their names. Folders are displayed before files. Files with nested children are displayed before other files.') -- ], -- 'markdownDescription': nls.localize('sortOrder', "Controls the property-based sorting of files and folders in the Explorer. When `#explorer.fileNesting.enabled#` is enabled, also controls sorting of nested files.") -- }, -- 'explorer.sortOrderLexicographicOptions': { -- 'type': 'string', -- 'enum': [LexicographicOptions.Default, LexicographicOptions.Upper, LexicographicOptions.Lower, LexicographicOptions.Unicode], -- 'default': LexicographicOptions.Default, -- 'enumDescriptions': [ -- nls.localize('sortOrderLexicographicOptions.default', 'Uppercase and lowercase names are mixed together.'), -- nls.localize('sortOrderLexicographicOptions.upper', 'Uppercase names are grouped together before lowercase names.'), -- nls.localize('sortOrderLexicographicOptions.lower', 'Lowercase names are grouped together before uppercase names.'), -- nls.localize('sortOrderLexicographicOptions.unicode', 'Names are sorted in Unicode order.') -- ], -- 'description': nls.localize('sortOrderLexicographicOptions', "Controls the lexicographic sorting of file and folder names in the Explorer.") -- }, -- 'explorer.sortOrderReverse': { -- 'type': 'boolean', -- 'description': nls.localize('sortOrderReverse', "Controls whether the file and folder sort order, should be reversed."), -- 'default': false, -- }, -- 'explorer.decorations.colors': { -- type: 'boolean', -- description: nls.localize('explorer.decorations.colors', "Controls whether file decorations should use colors."), -- default: true -- }, -- 'explorer.decorations.badges': { -- type: 'boolean', -- description: nls.localize('explorer.decorations.badges', "Controls whether file decorations should use badges."), -- default: true -- }, -- 'explorer.incrementalNaming': { -- 'type': 'string', -- enum: ['simple', 'smart', 'disabled'], -- enumDescriptions: [ -- nls.localize('simple', "Appends the word \"copy\" at the end of the duplicated name potentially followed by a number."), -- nls.localize('smart', "Adds a number at the end of the duplicated name. If some number is already part of the name, tries to increase that number."), -- nls.localize('disabled', "Disables incremental naming. If two files with the same name exist you will be prompted to overwrite the existing file.") -- ], -- description: nls.localize('explorer.incrementalNaming', "Controls which naming strategy to use when giving a new name to a duplicated Explorer item on paste."), -- default: 'simple' -- }, -- 'explorer.autoOpenDroppedFile': { -- 'type': 'boolean', -- 'description': nls.localize('autoOpenDroppedFile', "Controls whether the Explorer should automatically open a file when it is dropped into the explorer"), -- 'default': true -- }, -- 'explorer.compactFolders': { -- 'type': 'boolean', -- 'description': nls.localize('compressSingleChildFolders', "Controls whether the Explorer should render folders in a compact form. In such a form, single child folders will be compressed in a combined tree element. Useful for Java package structures, for example."), -- 'default': true -- }, -- 'explorer.copyRelativePathSeparator': { -- 'type': 'string', -- 'enum': [ -- '/', -- '\\', -- 'auto' -- ], -- 'enumDescriptions': [ -- nls.localize('copyRelativePathSeparator.slash', "Use slash as path separation character."), -- nls.localize('copyRelativePathSeparator.backslash', "Use backslash as path separation character."), -- nls.localize('copyRelativePathSeparator.auto', "Uses operating system specific path separation character."), -- ], -- 'description': nls.localize('copyRelativePathSeparator', "The path separation character used when copying relative file paths."), -- 'default': 'auto' -- }, -- 'explorer.excludeGitIgnore': { -- type: 'boolean', -- markdownDescription: nls.localize('excludeGitignore', "Controls whether entries in .gitignore should be parsed and excluded from the Explorer. Similar to {0}.", '`#files.exclude#`'), -- default: false, -- scope: ConfigurationScope.RESOURCE -- }, -- 'explorer.fileNesting.enabled': { -- 'type': 'boolean', -- scope: ConfigurationScope.RESOURCE, -- 'markdownDescription': nls.localize('fileNestingEnabled', "Controls whether file nesting is enabled in the Explorer. File nesting allows for related files in a directory to be visually grouped together under a single parent file."), -- 'default': false, -- }, -- 'explorer.fileNesting.expand': { -- 'type': 'boolean', -- 'markdownDescription': nls.localize('fileNestingExpand', "Controls whether file nests are automatically expanded. {0} must be set for this to take effect.", '`#explorer.fileNesting.enabled#`'), -- 'default': true, -- }, -- 'explorer.fileNesting.patterns': { -- 'type': 'object', -- scope: ConfigurationScope.RESOURCE, -- 'markdownDescription': nls.localize('fileNestingPatterns', "Controls nesting of files in the Explorer. {0} must be set for this to take effect. Each __Item__ represents a parent pattern and may contain a single `*` character that matches any string. Each __Value__ represents a comma separated list of the child patterns that should be shown nested under a given parent. Child patterns may contain several special tokens:\n- `${capture}`: Matches the resolved value of the `*` from the parent pattern\n- `${basename}`: Matches the parent file's basename, the `file` in `file.ts`\n- `${extname}`: Matches the parent file's extension, the `ts` in `file.ts`\n- `${dirname}`: Matches the parent file's directory name, the `src` in `src/file.ts`\n- `*`: Matches any string, may only be used once per child pattern", '`#explorer.fileNesting.enabled#`'), -- patternProperties: { -- '^[^*]*\\*?[^*]*$': { -- markdownDescription: nls.localize('fileNesting.description', "Each key pattern may contain a single `*` character which will match any string."), -- type: 'string', -- pattern: '^([^,*]*\\*?[^,*]*)(, ?[^,*]*\\*?[^,*]*)*$', -- } -- }, -- additionalProperties: false, -- 'default': { -- '*.ts': '${capture}.js', -- '*.js': '${capture}.js.map, ${capture}.min.js, ${capture}.d.ts', -- '*.jsx': '${capture}.js', -- '*.tsx': '${capture}.ts', -- 'tsconfig.json': 'tsconfig.*.json', -- 'package.json': 'package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb', -- } -- } -- } --}); -- --UndoCommand.addImplementation(110, 'explorer', (accessor: ServicesAccessor) => { -- const undoRedoService = accessor.get(IUndoRedoService); -- const explorerService = accessor.get(IExplorerService); -- const configurationService = accessor.get(IConfigurationService); -- -- const explorerCanUndo = configurationService.getValue().explorer.enableUndo; -- if (explorerService.hasViewFocus() && undoRedoService.canUndo(UNDO_REDO_SOURCE) && explorerCanUndo) { -- undoRedoService.undo(UNDO_REDO_SOURCE); -- return true; -- } -- -- return false; --}); -- --RedoCommand.addImplementation(110, 'explorer', (accessor: ServicesAccessor) => { -- const undoRedoService = accessor.get(IUndoRedoService); -- const explorerService = accessor.get(IExplorerService); -- const configurationService = accessor.get(IConfigurationService); -- -- const explorerCanUndo = configurationService.getValue().explorer.enableUndo; -- if (explorerService.hasViewFocus() && undoRedoService.canRedo(UNDO_REDO_SOURCE) && explorerCanUndo) { -- undoRedoService.redo(UNDO_REDO_SOURCE); -- return true; -- } -- -- return false; --}); -- --ModesRegistry.registerLanguage({ -- id: BINARY_TEXT_FILE_MODE, -- aliases: ['Binary'], -- mimetypes: ['text/x-code-binary'] --}); -+import './files.contribution._configuration.js'; -+import './files.contribution._editorPane.js'; -+import './files.contribution._fileEditorFactory.js'; -+import './files.contribution._explorer.js'; diff --git a/vscode-paches/0025-fix-replace-map-by-forEach.patch b/vscode-paches/0025-fix-replace-map-by-forEach.patch deleted file mode 100644 index db0b72db..00000000 --- a/vscode-paches/0025-fix-replace-map-by-forEach.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:50:13 +0100 -Subject: [PATCH] fix: replace map by forEach - ---- - src/vs/workbench/browser/parts/compositeBar.ts | 2 +- - src/vs/workbench/browser/parts/views/viewPaneContainer.ts | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/vs/workbench/browser/parts/compositeBar.ts b/src/vs/workbench/browser/parts/compositeBar.ts -index 5e83a9458bd..1a3545c6e24 100644 ---- a/src/vs/workbench/browser/parts/compositeBar.ts -+++ b/src/vs/workbench/browser/parts/compositeBar.ts -@@ -494,7 +494,7 @@ export class CompositeBar extends Widget implements ICompositeBar { - // Compute sizes only if visible. Otherwise the size measurment would be computed wrongly. - const currentItemsLength = compositeSwitcherBar.viewItems.length; - compositeSwitcherBar.push(items.map(composite => composite.activityAction)); -- items.map((composite, index) => this.compositeSizeInBar.set(composite.id, this.options.orientation === ActionsOrientation.VERTICAL -+ items.forEach((composite, index) => this.compositeSizeInBar.set(composite.id, this.options.orientation === ActionsOrientation.VERTICAL - ? compositeSwitcherBar.getHeight(currentItemsLength + index) - : compositeSwitcherBar.getWidth(currentItemsLength + index) - )); -diff --git a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts -index 1ca314af9d2..d93257cf1c3 100644 ---- a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts -+++ b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts -@@ -688,7 +688,7 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer { - } - - this.panes.filter(view => view.isVisible() !== visible) -- .map((view) => view.setVisible(visible)); -+ .forEach((view) => view.setVisible(visible)); - } - - isVisible(): boolean { diff --git a/vscode-paches/0026-feat-only-apply-style-on-specific-class.patch b/vscode-paches/0026-feat-only-apply-style-on-specific-class.patch deleted file mode 100644 index 6e889c12..00000000 --- a/vscode-paches/0026-feat-only-apply-style-on-specific-class.patch +++ /dev/null @@ -1,396 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:51:04 +0100 -Subject: [PATCH] feat: only apply style on specific class - ---- - src/vs/workbench/browser/media/style.css | 185 ++++++++++------------- - src/vs/workbench/browser/style.ts | 10 +- - 2 files changed, 89 insertions(+), 106 deletions(-) - -diff --git a/src/vs/workbench/browser/media/style.css b/src/vs/workbench/browser/media/style.css -index 6c9dbb9a0c9..4b381ddf79c 100644 ---- a/src/vs/workbench/browser/media/style.css -+++ b/src/vs/workbench/browser/media/style.css -@@ -9,56 +9,38 @@ - - /* Font Families (with CJK support) */ - --.mac { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } --.mac:lang(zh-Hans) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } --.mac:lang(zh-Hant) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } --.mac:lang(ja) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } --.mac:lang(ko) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; } -- --.windows { font-family: "Segoe WPC", "Segoe UI", sans-serif; } --.windows:lang(zh-Hans) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } --.windows:lang(zh-Hant) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } --.windows:lang(ja) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } --.windows:lang(ko) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } -+.mac .monaco-workbench-part, .mac.monaco-workbench-part { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } -+.mac:lang(zh-Hans) .monaco-workbench-part, .mac:lang(zh-Hans).monaco-workbench-part { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } -+.mac:lang(zh-Hant) .monaco-workbench-part, .mac:lang(zh-Hant).monaco-workbench-part { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } -+.mac:lang(ja) .monaco-workbench-part, .mac:lang(ja).monaco-workbench-part { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } -+.mac:lang(ko) .monaco-workbench-part, .mac:lang(ko).monaco-workbench-part { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; } -+ -+.windows .monaco-workbench-part, .windows.monaco-workbench-part { font-family: "Segoe WPC", "Segoe UI", sans-serif; } -+.windows:lang(zh-Hans) .monaco-workbench-part, .windows:lang(zh-Hans).monaco-workbench-part { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } -+.windows:lang(zh-Hant) .monaco-workbench-part, .windows:lang(zh-Hant).monaco-workbench-part { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } -+.windows:lang(ja) .monaco-workbench-part, .windows:lang(ja).monaco-workbench-part { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; } -+.windows:lang(ko) .monaco-workbench-part, .windows:lang(ko).monaco-workbench-part { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } - - /* Linux: add `system-ui` as first font and not `Ubuntu` to allow other distribution pick their standard OS font */ --.linux { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } --.linux:lang(zh-Hans) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } --.linux:lang(zh-Hant) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } --.linux:lang(ja) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } --.linux:lang(ko) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } -+.linux .monaco-workbench-part, .linux.monaco-workbench-part { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; } -+.linux:lang(zh-Hans) .monaco-workbench-part, .linux:lang(zh-Hans).monaco-workbench-part { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } -+.linux:lang(zh-Hant) .monaco-workbench-part, .linux:lang(zh-Hant).monaco-workbench-part { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } -+.linux:lang(ja) .monaco-workbench-part, .linux:lang(ja).monaco-workbench-part { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } -+.linux:lang(ko) .monaco-workbench-part, .linux:lang(ko).monaco-workbench-part { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } - --.mac { --monaco-monospace-font: "SF Mono", Monaco, Menlo, Courier, monospace; } --.windows { --monaco-monospace-font: Consolas, "Courier New", monospace; } --.linux { --monaco-monospace-font: "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace; } -+.mac .monaco-workbench-part, .mac.monaco-workbench-part { --monaco-monospace-font: "SF Mono", Monaco, Menlo, Courier, monospace; } -+.windows .monaco-workbench-part, .windows.monaco-workbench-part { --monaco-monospace-font: Consolas, "Courier New", monospace; } -+.linux .monaco-workbench-part, .linux.monaco-workbench-part { --monaco-monospace-font: "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace; } - - /* Global Styles */ - --body { -- height: 100%; -- width: 100%; -- margin: 0; -- padding: 0; -- overflow: hidden; -- font-size: 11px; -- user-select: none; -- -webkit-user-select: none; --} -- --body.web { -- position: fixed; /* prevent bounce effect */ --} -- --.monaco-workbench { -+.monaco-workbench-part { - font-size: 13px; - line-height: 1.4em; -- position: relative; -- z-index: 1; -- overflow: hidden; - color: var(--vscode-foreground); - } - --.monaco-workbench.web { -+.monaco-workbench.web .monaco-workbench-part, .monaco-workbench-part.web { - touch-action: none; /* Disable browser handling of all panning and zooming gestures. Removes 300ms touch delay. */ - } - -@@ -75,55 +57,56 @@ body.web { - border-radius: 10px; /* macOS Big Sur increased rounded corners size */ - } - --.monaco-workbench img { -+.monaco-workbench-part img { - border: 0; - } - --.monaco-workbench label { -+.monaco-workbench-part label { - cursor: pointer; - } - --.monaco-workbench a { -+.monaco-workbench-part a { - text-decoration: none; - } - -- --.monaco-workbench p > a { -+.monaco-workbench-part p > a { - text-decoration: var(--text-link-decoration); - } - --.monaco-workbench.underline-links { -+.monaco-workbench.underline-links .monaco-workbench-part { - --text-link-decoration: underline; - } - --.monaco-workbench.hc-black p > a, --.monaco-workbench.hc-light p > a { -+.monaco-workbench.hc-black .monaco-workbench-part p > a, -+.monaco-workbench.hc-light .monaco-workbench-part p > a, -+.monaco-workbench.hc-black.monaco-workbench-part p > a, -+.monaco-workbench.hc-light.monaco-workbench-part p > a { - text-decoration: underline !important; - } - --.monaco-workbench a:active { -+.monaco-workbench-part a:active { - color: inherit; - background-color: inherit; - } - --.monaco-workbench a.plain { -+.monaco-workbench-part a.plain { - color: inherit; - text-decoration: none; - } - --.monaco-workbench a.plain:hover, --.monaco-workbench a.plain.hover { -+.monaco-workbench-part a.plain:hover, -+.monaco-workbench-part a.plain.hover { - color: inherit; - text-decoration: none; - } - --.monaco-workbench input { -+.monaco-workbench-part input { - color: inherit; - font-family: inherit; - font-size: 100%; - } - --.monaco-workbench table { -+.monaco-workbench-part table { - /* - * Somehow this is required when tables show in floating windows - * to override the user-agent style which sets a specific color -@@ -133,48 +116,48 @@ body.web { - font-size: inherit; - } - --.monaco-workbench input::placeholder { color: var(--vscode-input-placeholderForeground); } --.monaco-workbench input::-webkit-input-placeholder { color: var(--vscode-input-placeholderForeground); } --.monaco-workbench input::-moz-placeholder { color: var(--vscode-input-placeholderForeground); } -+.monaco-workbench-part input::placeholder { color: var(--vscode-input-placeholderForeground); } -+.monaco-workbench-part input::-webkit-input-placeholder { color: var(--vscode-input-placeholderForeground); } -+.monaco-workbench-part input::-moz-placeholder { color: var(--vscode-input-placeholderForeground); } - --.monaco-workbench textarea::placeholder { color: var(--vscode-input-placeholderForeground); } --.monaco-workbench textarea::-webkit-input-placeholder { color: var(--vscode-input-placeholderForeground); } --.monaco-workbench textarea::-moz-placeholder { color: var(--vscode-input-placeholderForeground); } -+.monaco-workbench-part textarea::placeholder { color: var(--vscode-input-placeholderForeground); } -+.monaco-workbench-part textarea::-webkit-input-placeholder { color: var(--vscode-input-placeholderForeground); } -+.monaco-workbench-part textarea::-moz-placeholder { color: var(--vscode-input-placeholderForeground); } - --.monaco-workbench .pointer { -+.monaco-workbench-part .pointer { - cursor: pointer; - } - --.monaco-workbench.mac.monaco-font-aliasing-antialiased { -+.monaco-workbench.mac.monaco-font-aliasing-antialiased.monaco-workbench-part, .monaco-workbench.mac.monaco-font-aliasing-antialiased .monaco-workbench-part { - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - } - --.monaco-workbench.mac.monaco-font-aliasing-none { -+.monaco-workbench.mac.monaco-font-aliasing-none.monaco-workbench-part, .monaco-workbench.mac.monaco-font-aliasing-none .monaco-workbench-part { - -webkit-font-smoothing: none; - -moz-osx-font-smoothing: unset; - } - - @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { -- .monaco-workbench.mac.monaco-font-aliasing-auto { -+ .monaco-workbench.mac.monaco-font-aliasing-auto.monaco-workbench-part, .monaco-workbench.mac.monaco-font-aliasing-auto .monaco-workbench-part { - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - } - } - --.monaco-workbench .context-view { -+.monaco-workbench-part .context-view { - -webkit-app-region: no-drag; - } - --.monaco-workbench .codicon { -+.monaco-workbench-part .codicon { - color: var(--vscode-icon-foreground); - } - --.monaco-workbench .codicon[class*='codicon-'] { -+.monaco-workbench-part .codicon[class*='codicon-'] { - font-size: 16px; /* sets font-size for codicons in workbench (https://github.com/microsoft/vscode/issues/98495) */ - } - --.monaco-workbench .predefined-file-icon[class*='codicon-']::before { -+.monaco-workbench-part .predefined-file-icon[class*='codicon-']::before { - width: 16px; - padding-left: 3px; /* width (16px) - font-size (13px) = padding-left (3px) */ - padding-right: 3px; -@@ -194,7 +177,7 @@ body.web { - - /* Custom Dropdown (select) Arrows */ - --.monaco-workbench select { -+.monaco-workbench-part select { - font-family: inherit; - appearance: none; - -webkit-appearance: none; -@@ -203,11 +186,11 @@ body.web { - border: 1px solid; - } - --.monaco-workbench .select-container { -+.monaco-workbench-part .select-container { - position: relative; - } - --.monaco-workbench .select-container:after { -+.monaco-workbench-part .select-container:after { - content: var(--vscode-icon-chevron-down-content); - font-family: var(--vscode-icon-chevron-down-font-family); - font-size: 16px; -@@ -224,16 +207,16 @@ body.web { - - /* Keyboard Focus Indication Styles */ - --.monaco-workbench [tabindex="0"]:focus, --.monaco-workbench [tabindex="-1"]:focus, --.monaco-workbench .synthetic-focus, --.monaco-workbench select:focus, --.monaco-workbench input[type="button"]:focus, --.monaco-workbench input[type="text"]:focus, --.monaco-workbench button:focus, --.monaco-workbench textarea:focus, --.monaco-workbench input[type="search"]:focus, --.monaco-workbench input[type="checkbox"]:focus { -+.monaco-workbench-part [tabindex="0"]:focus, -+.monaco-workbench-part [tabindex="-1"]:focus, -+.monaco-workbench-part .synthetic-focus, -+.monaco-workbench-part select:focus, -+.monaco-workbench-part input[type="button"]:focus, -+.monaco-workbench-part input[type="text"]:focus, -+.monaco-workbench-part button:focus, -+.monaco-workbench-part textarea:focus, -+.monaco-workbench-part input[type="search"]:focus, -+.monaco-workbench-part input[type="checkbox"]:focus { - outline-width: 1px; - outline-style: solid; - outline-offset: -1px; -@@ -246,19 +229,19 @@ body.web { - background: transparent; /* Search input focus fix when in high contrast */ - } - --.monaco-workbench input[type="checkbox"]:focus { -+.monaco-workbench-part input[type="checkbox"]:focus { - outline-offset: 2px; - } - --.monaco-workbench [tabindex="0"]:active, --.monaco-workbench [tabindex="-1"]:active, --.monaco-workbench select:active, --.monaco-workbench input[type="button"]:active, --.monaco-workbench input[type="checkbox"]:active { -+.monaco-workbench-part [tabindex="0"]:active, -+.monaco-workbench-part [tabindex="-1"]:active, -+.monaco-workbench-part select:active, -+.monaco-workbench-part input[type="button"]:active, -+.monaco-workbench-part input[type="checkbox"]:active { - outline: 0 !important; /* fixes some flashing outlines from showing up when clicking */ - } - --.monaco-workbench.mac select:focus { -+.monaco-workbench.mac.monaco-workbench-part select:focus, .monaco-workbench.mac .monaco-workbench-part select:focus { - border-color: transparent; /* outline is a square, but border has a radius, so we avoid this glitch when focused (https://github.com/microsoft/vscode/issues/26045) */ - } - -@@ -286,38 +269,38 @@ body.web { - color: var(--vscode-list-focusHighlightForeground); - } - --.monaco-workbench .synthetic-focus :focus { -+.monaco-workbench-part .synthetic-focus :focus { - outline: 0 !important; /* elements within widgets that draw synthetic-focus should never show focus */ - } - --.monaco-workbench .monaco-inputbox.info.synthetic-focus, --.monaco-workbench .monaco-inputbox.warning.synthetic-focus, --.monaco-workbench .monaco-inputbox.error.synthetic-focus, --.monaco-workbench .monaco-inputbox.info input[type="text"]:focus, --.monaco-workbench .monaco-inputbox.warning input[type="text"]:focus, --.monaco-workbench .monaco-inputbox.error input[type="text"]:focus { -+.monaco-workbench-part .monaco-inputbox.info.synthetic-focus, -+.monaco-workbench-part .monaco-inputbox.warning.synthetic-focus, -+.monaco-workbench-part .monaco-inputbox.error.synthetic-focus, -+.monaco-workbench-part .monaco-inputbox.info input[type="text"]:focus, -+.monaco-workbench-part .monaco-inputbox.warning input[type="text"]:focus, -+.monaco-workbench-part .monaco-inputbox.error input[type="text"]:focus { - outline: 0 !important; /* outline is not going well with decoration */ - } - --.monaco-workbench .monaco-list:focus { -+.monaco-workbench-part .monaco-list:focus { - outline: 0 !important; /* tree indicates focus not via outline but through the focused item */ - } - --.monaco-workbench a.monaco-link:hover { -+.monaco-workbench-part a.monaco-link:hover { - text-decoration: underline; /* render underline on hover for accessibility requirements */ - } - --.monaco-workbench .monaco-action-bar:not(.vertical) .action-label:not(.disabled):hover, --.monaco-workbench .monaco-action-bar:not(.vertical) .monaco-dropdown-with-primary:not(.disabled):hover { -+.monaco-workbench-part .monaco-action-bar:not(.vertical) .action-label:not(.disabled):hover, -+.monaco-workbench-part .monaco-action-bar:not(.vertical) .monaco-dropdown-with-primary:not(.disabled):hover { - background-color: var(--vscode-toolbar-hoverBackground); - } - --.monaco-workbench .monaco-action-bar:not(.vertical) .action-item.active .action-label:not(.disabled), --.monaco-workbench .monaco-action-bar:not(.vertical) .monaco-dropdown.active .action-label:not(.disabled) { -+.monaco-workbench-part .monaco-action-bar:not(.vertical) .action-item.active .action-label:not(.disabled), -+.monaco-workbench-part .monaco-action-bar:not(.vertical) .monaco-dropdown.active .action-label:not(.disabled) { - background-color: var(--vscode-toolbar-activeBackground); - } - --.monaco-workbench .monaco-action-bar:not(.vertical) .action-item .action-label:hover:not(.disabled) { -+.monaco-workbench-part .monaco-action-bar:not(.vertical) .action-item .action-label:hover:not(.disabled) { - outline: 1px dashed var(--vscode-toolbar-hoverOutline); - outline-offset: -1px; - } -diff --git a/src/vs/workbench/browser/style.ts b/src/vs/workbench/browser/style.ts -index 9f36f4a74eb..de1352c0fe2 100644 ---- a/src/vs/workbench/browser/style.ts -+++ b/src/vs/workbench/browser/style.ts -@@ -16,12 +16,12 @@ registerThemingParticipant((theme, collector) => { - - // Background (helps for subpixel-antialiasing on Windows) - const workbenchBackground = WORKBENCH_BACKGROUND(theme); -- collector.addRule(`.monaco-workbench { background-color: ${workbenchBackground}; }`); -+ collector.addRule(`.monaco-workbench-part { background-color: ${workbenchBackground}; }`); - - // Selection (do NOT remove - https://github.com/microsoft/vscode/issues/169662) - const windowSelectionBackground = theme.getColor(selectionBackground); - if (windowSelectionBackground) { -- collector.addRule(`.monaco-workbench ::selection { background-color: ${windowSelectionBackground}; }`); -+ collector.addRule(`.monaco-workbench-part ::selection { background-color: ${windowSelectionBackground}; }`); - } - - // Update based on selected theme -@@ -45,10 +45,10 @@ registerThemingParticipant((theme, collector) => { - // allow to select text in monaco editor instances. - if (isSafari) { - collector.addRule(` -- body.web { -+ .monaco-workbench-part.web { - touch-action: none; - } -- .monaco-workbench .monaco-editor .view-lines { -+ .monaco-workbench-part .monaco-editor .view-lines { - user-select: text; - -webkit-user-select: text; - } -@@ -57,6 +57,6 @@ registerThemingParticipant((theme, collector) => { - - // Update body background color to ensure the home indicator area looks similar to the workbench - if (isIOS && isStandalone()) { -- collector.addRule(`body { background-color: ${workbenchBackground}; }`); -+ collector.addRule(`.monaco-workbench-part { background-color: ${workbenchBackground}; }`); - } - }); diff --git a/vscode-paches/0027-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch b/vscode-paches/0027-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch deleted file mode 100644 index aa511959..00000000 --- a/vscode-paches/0027-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:15:15 +0100 -Subject: [PATCH] fix: do not call FileAccess.asBrowserUri at the root of the - module - -to be able to register the file before ---- - .../extensions/browser/abstractRuntimeExtensionsEditor.ts | 6 +++--- - .../extensions/browser/extensionsWorkbenchService.ts | 4 ++-- - .../welcomeGettingStarted/browser/gettingStartedService.ts | 4 ++-- - .../extensionManagement/common/extensionManagement.ts | 2 +- - 4 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts b/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts -index f6873bf5524..b653ac57a36 100644 ---- a/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts -+++ b/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts -@@ -38,7 +38,7 @@ import { IEditorGroup } from '../../../services/editor/common/editorGroupsServic - import { IEditorService } from '../../../services/editor/common/editorService.js'; - import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.js'; - import { Extensions, IExtensionFeaturesManagementService, IExtensionFeaturesRegistry } from '../../../services/extensionManagement/common/extensionFeatures.js'; --import { DefaultIconPath, EnablementState } from '../../../services/extensionManagement/common/extensionManagement.js'; -+import { getDefaultIconPath, EnablementState } from '../../../services/extensionManagement/common/extensionManagement.js'; - import { LocalWebWorkerRunningLocation } from '../../../services/extensions/common/extensionRunningLocation.js'; - import { IExtensionHostProfile, IExtensionService, IExtensionsStatus } from '../../../services/extensions/common/extensions.js'; - import { IExtension, IExtensionsWorkbenchService } from '../common/extensions.js'; -@@ -277,8 +277,8 @@ export abstract class AbstractRuntimeExtensionsEditor extends EditorPane { - - data.root.classList.toggle('odd', index % 2 === 1); - -- data.elementDisposables.push(addDisposableListener(data.icon, 'error', () => data.icon.src = element.marketplaceInfo?.iconUrlFallback || DefaultIconPath, { once: true })); -- data.icon.src = element.marketplaceInfo?.iconUrl || DefaultIconPath; -+ data.elementDisposables.push(addDisposableListener(data.icon, 'error', () => data.icon.src = element.marketplaceInfo?.iconUrlFallback || getDefaultIconPath(), { once: true })); -+ data.icon.src = element.marketplaceInfo?.iconUrl || getDefaultIconPath(); - - if (!data.icon.complete) { - data.icon.style.visibility = 'hidden'; -diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts -index e34a9006982..307fc647c57 100644 ---- a/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts -+++ b/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts -@@ -19,7 +19,7 @@ import { - InstallOptions, IProductVersion, - UninstallExtensionInfo - } from '../../../../platform/extensionManagement/common/extensionManagement.js'; --import { IWorkbenchExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer, IWorkbenchExtensionManagementService, DefaultIconPath, IResourceExtension, extensionsConfigurationNodeBase } from '../../../services/extensionManagement/common/extensionManagement.js'; -+import { IWorkbenchExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer, IWorkbenchExtensionManagementService, getDefaultIconPath, IResourceExtension, extensionsConfigurationNodeBase } from '../../../services/extensionManagement/common/extensionManagement.js'; - import { getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData, areSameExtensions, groupByExtension, getGalleryExtensionId } from '../../../../platform/extensionManagement/common/extensionManagementUtil.js'; - import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; - import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; -@@ -272,7 +272,7 @@ export class Extension implements IExtension { - } - } - } -- return DefaultIconPath; -+ return getDefaultIconPath(); - } - - get repository(): string | undefined { -diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts -index a3d6f047f65..310fd38c68f 100644 ---- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts -+++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts -@@ -33,7 +33,7 @@ import { ITelemetryService } from '../../../../platform/telemetry/common/telemet - import { checkGlobFileExists } from '../../../services/extensions/common/workspaceContains.js'; - import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js'; - import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; --import { DefaultIconPath } from '../../../services/extensionManagement/common/extensionManagement.js'; -+import { getDefaultIconPath } from '../../../services/extensionManagement/common/extensionManagement.js'; - - export const HasMultipleNewFileEntries = new RawContextKey('hasMultipleNewFileEntries', false); - -@@ -395,7 +395,7 @@ export class WalkthroughsService extends Disposable implements IWalkthroughsServ - type: 'image', - path: iconStr - ? FileAccess.uriToBrowserUri(joinPath(extension.extensionLocation, iconStr)).toString(true) -- : DefaultIconPath -+ : getDefaultIconPath() - }, - when: ContextKeyExpr.deserialize(override ?? walkthrough.when) ?? ContextKeyExpr.true(), - } as const; -diff --git a/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts b/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts -index 0244e0aa381..5bd87b4b5ab 100644 ---- a/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts -+++ b/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts -@@ -43,7 +43,7 @@ export interface IExtensionManagementServerService { - getExtensionInstallLocation(extension: IExtension): ExtensionInstallLocation | null; - } - --export const DefaultIconPath = FileAccess.asBrowserUri('vs/workbench/services/extensionManagement/common/media/defaultIcon.png').toString(true); -+export const getDefaultIconPath = () => FileAccess.asBrowserUri('vs/workbench/services/extensionManagement/common/media/defaultIcon.png').toString(true); - - export interface IResourceExtension { - readonly type: 'resource'; diff --git a/vscode-paches/0028-cleanup-remove-some-checks-and-warnings.patch b/vscode-paches/0028-cleanup-remove-some-checks-and-warnings.patch deleted file mode 100644 index 9cee4389..00000000 --- a/vscode-paches/0028-cleanup-remove-some-checks-and-warnings.patch +++ /dev/null @@ -1,114 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:16:29 +0100 -Subject: [PATCH] cleanup: remove some checks and warnings - ---- - .../contrib/webview/browser/pre/service-worker.js | 3 +-- - .../contrib/webview/browser/webviewElement.ts | 10 ---------- - .../auxiliaryWindow/browser/auxiliaryWindowService.ts | 7 ------- - .../extensions/browser/webWorkerExtensionHost.ts | 2 -- - .../services/textMate/common/TMScopeRegistry.ts | 11 ----------- - 5 files changed, 1 insertion(+), 32 deletions(-) - -diff --git a/src/vs/workbench/contrib/webview/browser/pre/service-worker.js b/src/vs/workbench/contrib/webview/browser/pre/service-worker.js -index e5fa674ea82..c3e8d26f3da 100644 ---- a/src/vs/workbench/contrib/webview/browser/pre/service-worker.js -+++ b/src/vs/workbench/contrib/webview/browser/pre/service-worker.js -@@ -451,7 +451,6 @@ async function getOuterIframeClient(webviewId) { - const allClients = await sw.clients.matchAll({ includeUncontrolled: true }); - return allClients.filter(client => { - const clientUrl = new URL(client.url); -- const hasExpectedPathName = (clientUrl.pathname === `${rootPath}/` || clientUrl.pathname === `${rootPath}/index.html` || clientUrl.pathname === `${rootPath}/index-no-csp.html`); -- return hasExpectedPathName && clientUrl.searchParams.get('id') === webviewId; -+ return clientUrl.searchParams.get('id') === webviewId; - }); - } -diff --git a/src/vs/workbench/contrib/webview/browser/webviewElement.ts b/src/vs/workbench/contrib/webview/browser/webviewElement.ts -index 1b66babea28..44b1733ff0e 100644 ---- a/src/vs/workbench/contrib/webview/browser/webviewElement.ts -+++ b/src/vs/workbench/contrib/webview/browser/webviewElement.ts -@@ -492,11 +492,6 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD - return; - } - -- if (e.origin !== this._webviewContentOrigin(this._encodedWebviewOrigin)) { -- console.log(`Skipped renderer receiving message due to mismatched origins: ${e.origin} ${this._webviewContentOrigin}`); -- return; -- } -- - if (e.data.channel === 'webview-ready') { - if (this._messagePort) { - return; -@@ -551,11 +546,6 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD - return endpoint; - } - -- private _webviewContentOrigin(encodedWebviewOrigin: string): string { -- const uri = URI.parse(this.webviewContentEndpoint(encodedWebviewOrigin)); -- return uri.scheme + '://' + uri.authority.toLowerCase(); -- } -- - private doPostMessage(channel: string, data?: any, transferable: Transferable[] = []): boolean { - if (this.element && this._messagePort) { - this._messagePort.postMessage({ channel, args: data }, transferable); -diff --git a/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.ts b/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.ts -index c7fe91bfe1e..608ca8f7ce2 100644 ---- a/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.ts -+++ b/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.ts -@@ -364,13 +364,6 @@ export class BrowserAuxiliaryWindowService extends Disposable implements IAuxili - } - - protected createContainer(auxiliaryWindow: CodeWindow, disposables: DisposableStore, options?: IAuxiliaryWindowOpenOptions): { stylesLoaded: Barrier; container: HTMLElement } { -- auxiliaryWindow.document.createElement = function () { -- // Disallow `createElement` because it would create -- // HTML Elements in the "wrong" context and break -- // code that does "instanceof HTMLElement" etc. -- throw new Error('Not allowed to create elements in child window JavaScript context. Always use the main window so that "xyz instanceof HTMLElement" continues to work.'); -- }; -- - this.applyMeta(auxiliaryWindow); - const { stylesLoaded } = this.applyCSS(auxiliaryWindow, disposables); - const container = this.applyHTML(auxiliaryWindow, disposables); -diff --git a/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts b/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts -index 8141d1dfe02..6793d6c6fab 100644 ---- a/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts -+++ b/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts -@@ -113,8 +113,6 @@ export class WebWorkerExtensionHost extends Disposable implements IExtensionHost - res.searchParams.set('salt', stableOriginUUID); - return res.toString(); - } -- -- console.warn(`The web worker extension host is started in a same-origin iframe!`); - } - - const relativeExtensionHostIframeSrc = FileAccess.asBrowserUri(iframeModulePath); -diff --git a/src/vs/workbench/services/textMate/common/TMScopeRegistry.ts b/src/vs/workbench/services/textMate/common/TMScopeRegistry.ts -index ace5da0d59a..580cae23bdd 100644 ---- a/src/vs/workbench/services/textMate/common/TMScopeRegistry.ts -+++ b/src/vs/workbench/services/textMate/common/TMScopeRegistry.ts -@@ -3,7 +3,6 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - --import * as resources from '../../../../base/common/resources.js'; - import { URI } from '../../../../base/common/uri.js'; - import { LanguageId, StandardTokenType } from '../../../../editor/common/encodedTokenAttributes.js'; - -@@ -40,16 +39,6 @@ export class TMScopeRegistry { - } - - public register(def: IValidGrammarDefinition): void { -- if (this._scopeNameToLanguageRegistration[def.scopeName]) { -- const existingRegistration = this._scopeNameToLanguageRegistration[def.scopeName]; -- if (!resources.isEqual(existingRegistration.location, def.location)) { -- console.warn( -- `Overwriting grammar scope name to file mapping for scope ${def.scopeName}.\n` + -- `Old grammar file: ${existingRegistration.location.toString()}.\n` + -- `New grammar file: ${def.location.toString()}` -- ); -- } -- } - this._scopeNameToLanguageRegistration[def.scopeName] = def; - } - diff --git a/vscode-paches/0029-refactor-split-class-in-2.patch b/vscode-paches/0029-refactor-split-class-in-2.patch deleted file mode 100644 index 55bbda00..00000000 --- a/vscode-paches/0029-refactor-split-class-in-2.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:17:31 +0100 -Subject: [PATCH] refactor: split class in 2 - ---- - .../extensions/browser/extensionService.ts | 94 +++++++++++++++---- - 1 file changed, 76 insertions(+), 18 deletions(-) - -diff --git a/src/vs/workbench/services/extensions/browser/extensionService.ts b/src/vs/workbench/services/extensions/browser/extensionService.ts -index b232937c792..e48e1d79a07 100644 ---- a/src/vs/workbench/services/extensions/browser/extensionService.ts -+++ b/src/vs/workbench/services/extensions/browser/extensionService.ts -@@ -43,8 +43,10 @@ import { IUserDataInitializationService } from '../../userData/browser/userDataI - import { IUserDataProfileService } from '../../userDataProfile/common/userDataProfile.js'; - - export class ExtensionService extends AbstractExtensionService implements IExtensionService { -- - constructor( -+ extensionsProposedApi: ExtensionsProposedApi, -+ extensionHostFactory: IExtensionHostFactory, -+ extensionHostKindPicker: IExtensionHostKindPicker, - @IInstantiationService instantiationService: IInstantiationService, - @INotificationService notificationService: INotificationService, - @IBrowserWorkbenchEnvironmentService private readonly _browserEnvironmentService: IBrowserWorkbenchEnvironmentService, -@@ -68,21 +70,10 @@ export class ExtensionService extends AbstractExtensionService implements IExten - @IRemoteExplorerService private readonly _remoteExplorerService: IRemoteExplorerService, - @IDialogService dialogService: IDialogService, - ) { -- const extensionsProposedApi = instantiationService.createInstance(ExtensionsProposedApi); -- const extensionHostFactory = new BrowserExtensionHostFactory( -- extensionsProposedApi, -- () => this._scanWebExtensions(), -- () => this._getExtensionRegistrySnapshotWhenReady(), -- instantiationService, -- remoteAgentService, -- remoteAuthorityResolverService, -- extensionEnablementService, -- logService -- ); - super( - extensionsProposedApi, - extensionHostFactory, -- new BrowserExtensionHostKindPicker(logService), -+ extensionHostKindPicker, - instantiationService, - notificationService, - _browserEnvironmentService, -@@ -206,10 +197,10 @@ export class BrowserExtensionHostFactory implements IExtensionHostFactory { - private readonly _extensionsProposedApi: ExtensionsProposedApi, - private readonly _scanWebExtensions: () => Promise, - private readonly _getExtensionRegistrySnapshotWhenReady: () => Promise, -- @IInstantiationService private readonly _instantiationService: IInstantiationService, -- @IRemoteAgentService private readonly _remoteAgentService: IRemoteAgentService, -- @IRemoteAuthorityResolverService private readonly _remoteAuthorityResolverService: IRemoteAuthorityResolverService, -- @IWorkbenchExtensionEnablementService private readonly _extensionEnablementService: IWorkbenchExtensionEnablementService, -+ @IInstantiationService protected readonly _instantiationService: IInstantiationService, -+ @IRemoteAgentService protected readonly _remoteAgentService: IRemoteAgentService, -+ @IRemoteAuthorityResolverService protected readonly _remoteAuthorityResolverService: IRemoteAuthorityResolverService, -+ @IWorkbenchExtensionEnablementService protected readonly _extensionEnablementService: IWorkbenchExtensionEnablementService, - @ILogService private readonly _logService: ILogService, - ) { } - -@@ -333,4 +324,71 @@ export class BrowserExtensionHostKindPicker implements IExtensionHostKindPicker - } - } - --registerSingleton(IExtensionService, ExtensionService, InstantiationType.Eager); -+export class BrowserExtensionService extends ExtensionService { -+ constructor( -+ @IInstantiationService instantiationService: IInstantiationService, -+ @INotificationService notificationService: INotificationService, -+ @IBrowserWorkbenchEnvironmentService browserEnvironmentService: IBrowserWorkbenchEnvironmentService, -+ @ITelemetryService telemetryService: ITelemetryService, -+ @IWorkbenchExtensionEnablementService extensionEnablementService: IWorkbenchExtensionEnablementService, -+ @IFileService fileService: IFileService, -+ @IProductService productService: IProductService, -+ @IWorkbenchExtensionManagementService extensionManagementService: IWorkbenchExtensionManagementService, -+ @IWorkspaceContextService contextService: IWorkspaceContextService, -+ @IConfigurationService configurationService: IConfigurationService, -+ @IExtensionManifestPropertiesService extensionManifestPropertiesService: IExtensionManifestPropertiesService, -+ @IWebExtensionsScannerService webExtensionsScannerService: IWebExtensionsScannerService, -+ @ILogService logService: ILogService, -+ @IRemoteAgentService remoteAgentService: IRemoteAgentService, -+ @IRemoteExtensionsScannerService remoteExtensionsScannerService: IRemoteExtensionsScannerService, -+ @ILifecycleService lifecycleService: ILifecycleService, -+ @IRemoteAuthorityResolverService remoteAuthorityResolverService: IRemoteAuthorityResolverService, -+ @IUserDataInitializationService userDataInitializationService: IUserDataInitializationService, -+ @IUserDataProfileService userDataProfileService: IUserDataProfileService, -+ @IWorkspaceTrustManagementService workspaceTrustManagementService: IWorkspaceTrustManagementService, -+ @IRemoteExplorerService remoteExplorerService: IRemoteExplorerService, -+ @IDialogService dialogService: IDialogService, -+ ) { -+ const extensionsProposedApi = instantiationService.createInstance(ExtensionsProposedApi); -+ const extensionHostFactory = new BrowserExtensionHostFactory( -+ extensionsProposedApi, -+ () => this._scanWebExtensions(), -+ () => this._getExtensionRegistrySnapshotWhenReady(), -+ instantiationService, -+ remoteAgentService, -+ remoteAuthorityResolverService, -+ extensionEnablementService, -+ logService -+ ); -+ super( -+ extensionsProposedApi, -+ extensionHostFactory, -+ new BrowserExtensionHostKindPicker(logService), -+ instantiationService, -+ notificationService, -+ browserEnvironmentService, -+ telemetryService, -+ extensionEnablementService, -+ fileService, -+ productService, -+ extensionManagementService, -+ contextService, -+ configurationService, -+ extensionManifestPropertiesService, -+ webExtensionsScannerService, -+ logService, -+ remoteAgentService, -+ remoteExtensionsScannerService, -+ lifecycleService, -+ remoteAuthorityResolverService, -+ userDataInitializationService, -+ userDataProfileService, -+ workspaceTrustManagementService, -+ remoteExplorerService, -+ dialogService -+ ); -+ } -+} -+ -+ -+registerSingleton(IExtensionService, BrowserExtensionService, InstantiationType.Eager); diff --git a/vscode-paches/0030-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch b/vscode-paches/0030-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch deleted file mode 100644 index 234baff2..00000000 --- a/vscode-paches/0030-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:18:39 +0100 -Subject: [PATCH] fix: mark process supported as soon as there is a registered - backend - ---- - src/vs/platform/terminal/common/terminal.ts | 30 ++++++++++++++----- - .../terminal/browser/terminalService.ts | 14 +++++++-- - 2 files changed, 33 insertions(+), 11 deletions(-) - -diff --git a/src/vs/platform/terminal/common/terminal.ts b/src/vs/platform/terminal/common/terminal.ts -index a821d841916..5b7f5226641 100644 ---- a/src/vs/platform/terminal/common/terminal.ts -+++ b/src/vs/platform/terminal/common/terminal.ts -@@ -3,7 +3,7 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - --import { Event } from '../../../base/common/event.js'; -+import { Emitter, Event } from '../../../base/common/event.js'; - import { IProcessEnvironment, OperatingSystem } from '../../../base/common/platform.js'; - import { URI, UriComponents } from '../../../base/common/uri.js'; - import { createDecorator } from '../../instantiation/common/instantiation.js'; -@@ -1055,12 +1055,27 @@ export const TerminalExtensions = { - Backend: 'workbench.contributions.terminal.processBackend' - }; - -+function sanitizeRemoteAuthority(remoteAuthority: string | undefined) { -+ // Normalize the key to lowercase as the authority is case-insensitive -+ return remoteAuthority?.toLowerCase() ?? ''; -+} -+ -+export class TerminalBackendChangeEvent { -+ constructor(public readonly remoteAuthority: string | undefined) { } -+ -+ public affects(remoteAuthority?: string): boolean { -+ return sanitizeRemoteAuthority(remoteAuthority) === this.remoteAuthority; -+ } -+} -+ - export interface ITerminalBackendRegistry { - /** - * Gets all backends in the registry. - */ - backends: ReadonlyMap; - -+ onDidChangeBackends: Event; -+ - /** - * Registers a terminal backend for a remote authority. - */ -@@ -1077,21 +1092,20 @@ class TerminalBackendRegistry implements ITerminalBackendRegistry { - - get backends(): ReadonlyMap { return this._backends; } - -+ private _onDidChangeBackends = new Emitter(); -+ readonly onDidChangeBackends: Event = this._onDidChangeBackends.event; -+ - registerTerminalBackend(backend: ITerminalBackend): void { -- const key = this._sanitizeRemoteAuthority(backend.remoteAuthority); -+ const key = sanitizeRemoteAuthority(backend.remoteAuthority); - if (this._backends.has(key)) { - throw new Error(`A terminal backend with remote authority '${key}' was already registered.`); - } - this._backends.set(key, backend); -+ this._onDidChangeBackends.fire(new TerminalBackendChangeEvent(key)); - } - - getTerminalBackend(remoteAuthority: string | undefined): ITerminalBackend | undefined { -- return this._backends.get(this._sanitizeRemoteAuthority(remoteAuthority)); -- } -- -- private _sanitizeRemoteAuthority(remoteAuthority: string | undefined) { -- // Normalize the key to lowercase as the authority is case-insensitive -- return remoteAuthority?.toLowerCase() ?? ''; -+ return this._backends.get(sanitizeRemoteAuthority(remoteAuthority)); - } - } - Registry.add(TerminalExtensions.Backend, new TerminalBackendRegistry()); -diff --git a/src/vs/workbench/contrib/terminal/browser/terminalService.ts b/src/vs/workbench/contrib/terminal/browser/terminalService.ts -index b1da8a45dd8..9ec62d935d7 100644 ---- a/src/vs/workbench/contrib/terminal/browser/terminalService.ts -+++ b/src/vs/workbench/contrib/terminal/browser/terminalService.ts -@@ -19,7 +19,7 @@ import { IContextKey, IContextKeyService } from '../../../../platform/contextkey - import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js'; - import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; - import { INotificationService } from '../../../../platform/notification/common/notification.js'; --import { ICreateContributedTerminalProfileOptions, IExtensionTerminalProfile, IPtyHostAttachTarget, IRawTerminalInstanceLayoutInfo, IRawTerminalTabLayoutInfo, IShellLaunchConfig, ITerminalBackend, ITerminalLaunchError, ITerminalLogService, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, TerminalExitReason, TerminalLocation, TerminalLocationString, TitleEventSource } from '../../../../platform/terminal/common/terminal.js'; -+import { ICreateContributedTerminalProfileOptions, IExtensionTerminalProfile, IPtyHostAttachTarget, IRawTerminalInstanceLayoutInfo, IRawTerminalTabLayoutInfo, IShellLaunchConfig, ITerminalBackend, ITerminalBackendRegistry, ITerminalLaunchError, ITerminalLogService, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, TerminalExitReason, TerminalExtensions, TerminalLocation, TerminalLocationString, TitleEventSource } from '../../../../platform/terminal/common/terminal.js'; - import { formatMessageForTerminal } from '../../../../platform/terminal/common/terminalStrings.js'; - import { iconForeground } from '../../../../platform/theme/common/colorRegistry.js'; - import { getIconRegistry } from '../../../../platform/theme/common/iconRegistry.js'; -@@ -57,6 +57,7 @@ import { ITerminalCapabilityImplMap, TerminalCapability } from '../../../../plat - import { createInstanceCapabilityEventMultiplexer } from './terminalEvents.js'; - import { mainWindow } from '../../../../base/browser/window.js'; - import { GroupIdentifier } from '../../../common/editor.js'; -+import { Registry } from '../../../../platform/registry/common/platform.js'; - - export class TerminalService extends Disposable implements ITerminalService { - declare _serviceBrand: undefined; -@@ -216,7 +217,14 @@ export class TerminalService extends Disposable implements ITerminalService { - this._handleInstanceContextKeys(); - this._terminalShellTypeContextKey = TerminalContextKeys.shellType.bindTo(this._contextKeyService); - this._processSupportContextKey = TerminalContextKeys.processSupported.bindTo(this._contextKeyService); -- this._processSupportContextKey.set(!isWeb || this._remoteAgentService.getConnection() !== null); -+ -+ const backendRegistry = Registry.as(TerminalExtensions.Backend); -+ this._processSupportContextKey.set(backendRegistry.getTerminalBackend(_remoteAgentService.getConnection()?.remoteAuthority) !== undefined); -+ this._register(backendRegistry.onDidChangeBackends((e) => { -+ if (e.affects(_remoteAgentService.getConnection()?.remoteAuthority)) { -+ this.registerProcessSupport(backendRegistry.getTerminalBackend(_remoteAgentService.getConnection()?.remoteAuthority) !== undefined); -+ } -+ })); - this._terminalHasBeenCreated = TerminalContextKeys.terminalHasBeenCreated.bindTo(this._contextKeyService); - this._terminalCountContextKey = TerminalContextKeys.count.bindTo(this._contextKeyService); - this._terminalEditorActive = TerminalContextKeys.terminalEditorActive.bindTo(this._contextKeyService); -@@ -880,7 +888,7 @@ export class TerminalService extends Disposable implements ITerminalService { - } - - registerProcessSupport(isSupported: boolean): void { -- if (!isSupported) { -+ if (!isSupported || this._processSupportContextKey.get()) { - return; - } - this._processSupportContextKey.set(isSupported); diff --git a/vscode-paches/0031-fix-use-asBrowserUri-to-get-iframe-src.patch b/vscode-paches/0031-fix-use-asBrowserUri-to-get-iframe-src.patch deleted file mode 100644 index f7dd1934..00000000 --- a/vscode-paches/0031-fix-use-asBrowserUri-to-get-iframe-src.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:21:20 +0100 -Subject: [PATCH] fix: use asBrowserUri to get iframe src - ---- - src/vs/workbench/contrib/webview/browser/webviewElement.ts | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/vs/workbench/contrib/webview/browser/webviewElement.ts b/src/vs/workbench/contrib/webview/browser/webviewElement.ts -index 44b1733ff0e..2edd01a5bb4 100644 ---- a/src/vs/workbench/contrib/webview/browser/webviewElement.ts -+++ b/src/vs/workbench/contrib/webview/browser/webviewElement.ts -@@ -448,7 +448,8 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD - // Workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1754872 - const fileName = isFirefox ? 'index-no-csp.html' : 'index.html'; - -- this.element!.setAttribute('src', `${this.webviewContentEndpoint(encodedWebviewOrigin)}/${fileName}?${queryString}`); -+ const relativeIframeSrc = FileAccess.asBrowserUri(`vs/workbench/contrib/webview/browser/pre/${fileName}`); -+ this.element!.setAttribute('src', `${relativeIframeSrc.toString(true)}?${queryString}`); - } - - public mountTo(element: HTMLElement, targetWindow: CodeWindow) { diff --git a/vscode-paches/0032-feat-add-some-parameter-to-webview-iframes.patch b/vscode-paches/0032-feat-add-some-parameter-to-webview-iframes.patch deleted file mode 100644 index e2c9c7cc..00000000 --- a/vscode-paches/0032-feat-add-some-parameter-to-webview-iframes.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:21:40 +0100 -Subject: [PATCH] feat: add some parameter to webview iframes - ---- - src/vs/workbench/contrib/webview/browser/webviewElement.ts | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/vs/workbench/contrib/webview/browser/webviewElement.ts b/src/vs/workbench/contrib/webview/browser/webviewElement.ts -index 2edd01a5bb4..f24f65239fc 100644 ---- a/src/vs/workbench/contrib/webview/browser/webviewElement.ts -+++ b/src/vs/workbench/contrib/webview/browser/webviewElement.ts -@@ -11,7 +11,7 @@ import { streamToBuffer, VSBufferReadableStream } from '../../../../base/common/ - import { CancellationTokenSource } from '../../../../base/common/cancellation.js'; - import { Emitter, Event } from '../../../../base/common/event.js'; - import { Disposable, IDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; --import { COI } from '../../../../base/common/network.js'; -+import { COI, FileAccess } from '../../../../base/common/network.js'; - import { URI } from '../../../../base/common/uri.js'; - import { generateUuid } from '../../../../base/common/uuid.js'; - import { localize } from '../../../../nls.js'; -@@ -441,6 +441,9 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD - params.purpose = options.purpose; - } - -+ params.serviceWorkerUri = FileAccess.asBrowserUri('vs/workbench/contrib/webview/browser/pre/service-worker.js').toString(true); -+ params.fakeHtmlUri = FileAccess.asBrowserUri('vs/workbench/contrib/webview/browser/pre/fake.html').toString(true); -+ - COI.addSearchParam(params, true, true); - - const queryString = new URLSearchParams(params).toString(); diff --git a/vscode-paches/0033-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch b/vscode-paches/0033-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch deleted file mode 100644 index 9cf3c23a..00000000 --- a/vscode-paches/0033-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:22:48 +0100 -Subject: [PATCH] fix: only detect fullscreen if it's not a guess - ---- - .../services/host/browser/browserHostService.ts | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/src/vs/workbench/services/host/browser/browserHostService.ts b/src/vs/workbench/services/host/browser/browserHostService.ts -index 88d7b0db4c2..7499230f9ed 100644 ---- a/src/vs/workbench/services/host/browser/browserHostService.ts -+++ b/src/vs/workbench/services/host/browser/browserHostService.ts -@@ -213,13 +213,18 @@ export class BrowserHostService extends Disposable implements IHostService { - const windowId = getWindowId(window); - const viewport = isIOS && window.visualViewport ? window.visualViewport /** Visual viewport */ : window /** Layout viewport */; - -+ const isFullScreen = () => { -+ const fullScreen = detectFullscreen(window); -+ return fullScreen !== null && !fullScreen.guess; -+ }; -+ - // Fullscreen (Browser) - for (const event of [EventType.FULLSCREEN_CHANGE, EventType.WK_FULLSCREEN_CHANGE]) { -- disposables.add(addDisposableListener(window.document, event, () => emitter.fire({ windowId, fullscreen: !!detectFullscreen(window) }))); -+ disposables.add(addDisposableListener(window.document, event, () => emitter.fire({ windowId, fullscreen: isFullScreen() }))); - } - - // Fullscreen (Native) -- disposables.add(addDisposableThrottledListener(viewport, EventType.RESIZE, () => emitter.fire({ windowId, fullscreen: !!detectFullscreen(window) }), undefined, isMacintosh ? 2000 /* adjust for macOS animation */ : 800 /* can be throttled */)); -+ disposables.add(addDisposableThrottledListener(viewport, EventType.RESIZE, () => emitter.fire({ windowId, fullscreen: isFullScreen() }), undefined, isMacintosh ? 2000 /* adjust for macOS animation */ : 800 /* can be throttled */)); - }, { window: mainWindow, disposables: this._store })); - - return emitter.event; diff --git a/vscode-paches/0034-fix-only-use-open-model.patch b/vscode-paches/0034-fix-only-use-open-model.patch deleted file mode 100644 index c867fee0..00000000 --- a/vscode-paches/0034-fix-only-use-open-model.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:24:35 +0100 -Subject: [PATCH] fix: only use open model - ---- - .../browser/languageDetectionSimpleWorker.ts | 61 +------------------ - 1 file changed, 3 insertions(+), 58 deletions(-) - -diff --git a/src/vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker.ts b/src/vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker.ts -index f9e86fbd6b3..e949ee95479 100644 ---- a/src/vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker.ts -+++ b/src/vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker.ts -@@ -3,15 +3,12 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - --import type { ModelOperations, ModelResult } from '@vscode/vscode-languagedetection'; --import { importAMDNodeModule } from '../../../../amdX.js'; -+import { ModelOperations, ModelResult } from '@vscode/vscode-languagedetection'; - import { StopWatch } from '../../../../base/common/stopwatch.js'; - import { IRequestHandler, IWorkerServer } from '../../../../base/common/worker/simpleWorker.js'; - import { LanguageDetectionWorkerHost, ILanguageDetectionWorker } from './languageDetectionWorker.protocol.js'; - import { WorkerTextModelSyncServer } from '../../../../editor/common/services/textModelSync/textModelSync.impl.js'; - --type RegexpModel = { detect: (inp: string, langBiases: Record, supportedLangs?: string[]) => string | undefined }; -- - /** - * Defines the worker entry point. Must be exported and named `create`. - * @skipMangle -@@ -34,8 +31,6 @@ export class LanguageDetectionSimpleWorker implements ILanguageDetectionWorker { - private readonly _workerTextModelSyncServer = new WorkerTextModelSyncServer(); - - private readonly _host: LanguageDetectionWorkerHost; -- private _regexpModel: RegexpModel | undefined; -- private _regexpLoadFailed: boolean = false; - - private _modelOperations: ModelOperations | undefined; - private _loadFailed: boolean = false; -@@ -74,19 +69,8 @@ export class LanguageDetectionSimpleWorker implements ILanguageDetectionWorker { - return undefined; - }; - -- const historicalResolver = async () => this.runRegexpModel(documentTextSample, langBiases ?? {}, supportedLangs); -- -- if (preferHistory) { -- const history = await historicalResolver(); -- if (history) { return history; } -- const neural = await neuralResolver(); -- if (neural) { return neural; } -- } else { -- const neural = await neuralResolver(); -- if (neural) { return neural; } -- const history = await historicalResolver(); -- if (history) { return history; } -- } -+ const neural = await neuralResolver(); -+ if (neural) { return neural; } - - return undefined; - } -@@ -105,50 +89,11 @@ export class LanguageDetectionSimpleWorker implements ILanguageDetectionWorker { - return content; - } - -- private async getRegexpModel(): Promise { -- if (this._regexpLoadFailed) { -- return; -- } -- if (this._regexpModel) { -- return this._regexpModel; -- } -- const uri: string = await this._host.$getRegexpModelUri(); -- try { -- this._regexpModel = await importAMDNodeModule(uri, '') as RegexpModel; -- return this._regexpModel; -- } catch (e) { -- this._regexpLoadFailed = true; -- // console.warn('error loading language detection model', e); -- return; -- } -- } -- -- private async runRegexpModel(content: string, langBiases: Record, supportedLangs?: string[]): Promise { -- const regexpModel = await this.getRegexpModel(); -- if (!regexpModel) { return; } -- -- if (supportedLangs?.length) { -- // When using supportedLangs, normally computed biases are too extreme. Just use a "bitmask" of sorts. -- for (const lang of Object.keys(langBiases)) { -- if (supportedLangs.includes(lang)) { -- langBiases[lang] = 1; -- } else { -- langBiases[lang] = 0; -- } -- } -- } -- -- const detected = regexpModel.detect(content, langBiases, supportedLangs); -- return detected; -- } -- - private async getModelOperations(): Promise { - if (this._modelOperations) { - return this._modelOperations; - } - -- const uri: string = await this._host.$getIndexJsUri(); -- const { ModelOperations } = await importAMDNodeModule(uri, '') as typeof import('@vscode/vscode-languagedetection'); - this._modelOperations = new ModelOperations({ - modelJsonLoaderFunc: async () => { - const response = await fetch(await this._host.$getModelJsonUri()); diff --git a/vscode-paches/0035-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch b/vscode-paches/0035-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch deleted file mode 100644 index c55d11bc..00000000 --- a/vscode-paches/0035-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Fri, 13 Sep 2024 12:37:59 +0200 -Subject: [PATCH] fix: replace CJS require by FileAccess.toModuleContent - ---- - .../browser/gettingStartedDetailsRenderer.ts | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedDetailsRenderer.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedDetailsRenderer.ts -index a2e56672926..89372f739df 100644 ---- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedDetailsRenderer.ts -+++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedDetailsRenderer.ts -@@ -18,6 +18,7 @@ import { INotificationService } from '../../../../platform/notification/common/n - import { ILanguageService } from '../../../../editor/common/languages/language.js'; - import { IExtensionService } from '../../../services/extensions/common/extensions.js'; - import { gettingStartedContentRegistry } from '../common/gettingStartedContent.js'; -+import { AppResourcePath, FileAccess } from '../../../../base/common/network.js'; - - - export class GettingStartedDetailsRenderer { -@@ -273,7 +274,7 @@ export class GettingStartedDetailsRenderer { - } - - const transformUri = (src: string, base: URI) => { -- const path = joinPath(base, src); -+ const path = FileAccess.asBrowserUri(joinPath(base, src).path.slice(1) as AppResourcePath); - return asWebviewUri(path).toString(true); - }; - diff --git a/vscode-paches/0036-fix-allow-adding-a-local-folder-even-when-there-is-a.patch b/vscode-paches/0036-fix-allow-adding-a-local-folder-even-when-there-is-a.patch deleted file mode 100644 index d1abeaca..00000000 --- a/vscode-paches/0036-fix-allow-adding-a-local-folder-even-when-there-is-a.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:25:28 +0100 -Subject: [PATCH] fix: allow adding a local folder even when there is a remote - connection - ---- - .../workspaces/browser/abstractWorkspaceEditingService.ts | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - -diff --git a/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts b/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts -index 25fd78863cb..adc23e4e539 100644 ---- a/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts -+++ b/src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts -@@ -14,7 +14,7 @@ import { ConfigurationScope, IConfigurationRegistry, Extensions as Configuration - import { Registry } from '../../../../platform/registry/common/platform.js'; - import { ICommandService } from '../../../../platform/commands/common/commands.js'; - import { distinct } from '../../../../base/common/arrays.js'; --import { basename, isEqual, isEqualAuthority, joinPath, removeTrailingPathSeparator } from '../../../../base/common/resources.js'; -+import { basename, isEqual, joinPath, removeTrailingPathSeparator } from '../../../../base/common/resources.js'; - import { INotificationService, Severity } from '../../../../platform/notification/common/notification.js'; - import { IFileService } from '../../../../platform/files/common/files.js'; - import { IWorkbenchEnvironmentService } from '../../environment/common/environmentService.js'; -@@ -172,11 +172,6 @@ export abstract class AbstractWorkspaceEditingService extends Disposable impleme - - private async doAddFolders(foldersToAdd: IWorkspaceFolderCreationData[], index?: number, donotNotifyError: boolean = false): Promise { - const state = this.contextService.getWorkbenchState(); -- const remoteAuthority = this.environmentService.remoteAuthority; -- if (remoteAuthority) { -- // https://github.com/microsoft/vscode/issues/94191 -- foldersToAdd = foldersToAdd.filter(folder => folder.uri.scheme !== Schemas.file && (folder.uri.scheme !== Schemas.vscodeRemote || isEqualAuthority(folder.uri.authority, remoteAuthority))); -- } - - // If we are in no-workspace or single-folder workspace, adding folders has to - // enter a workspace. diff --git a/vscode-paches/0037-feat-allow-to-switch-storage-service-workspace.patch b/vscode-paches/0037-feat-allow-to-switch-storage-service-workspace.patch deleted file mode 100644 index 2ea089f6..00000000 --- a/vscode-paches/0037-feat-allow-to-switch-storage-service-workspace.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:26:01 +0100 -Subject: [PATCH] feat: allow to switch storage service workspace - ---- - .../storage/browser/storageService.ts | 25 +++++++++++++++---- - 1 file changed, 20 insertions(+), 5 deletions(-) - -diff --git a/src/vs/workbench/services/storage/browser/storageService.ts b/src/vs/workbench/services/storage/browser/storageService.ts -index 68573404c1e..0473b91da5e 100644 ---- a/src/vs/workbench/services/storage/browser/storageService.ts -+++ b/src/vs/workbench/services/storage/browser/storageService.ts -@@ -34,6 +34,7 @@ export class BrowserStorageService extends AbstractStorageService { - - private workspaceStorage: IStorage | undefined; - private workspaceStorageDatabase: IIndexedDBStorageDatabase | undefined; -+ private readonly workspaceStorageDisposables = this._register(new DisposableStore()); - - get hasPendingUpdate(): boolean { - return Boolean( -@@ -44,7 +45,7 @@ export class BrowserStorageService extends AbstractStorageService { - } - - constructor( -- private readonly workspace: IAnyWorkspaceIdentifier, -+ private workspace: IAnyWorkspaceIdentifier, - private readonly userDataProfileService: IUserDataProfileService, - @ILogService private readonly logService: ILogService, - ) { -@@ -118,12 +119,15 @@ export class BrowserStorageService extends AbstractStorageService { - } - - private async createWorkspaceStorage(): Promise { -+ // First clear any previously associated disposables -+ this.workspaceStorageDisposables.clear(); -+ - const workspaceStorageIndexedDB = await IndexedDBStorageDatabase.createWorkspaceStorage(this.workspace.id, this.logService); - -- this.workspaceStorageDatabase = this._register(workspaceStorageIndexedDB); -- this.workspaceStorage = this._register(new Storage(this.workspaceStorageDatabase)); -+ this.workspaceStorageDatabase = this.workspaceStorageDisposables.add(workspaceStorageIndexedDB); -+ this.workspaceStorage = this.workspaceStorageDisposables.add(new Storage(this.workspaceStorageDatabase)); - -- this._register(this.workspaceStorage.onDidChangeStorage(e => this.emitDidChangeValue(StorageScope.WORKSPACE, e))); -+ this.workspaceStorageDisposables.add(this.workspaceStorage.onDidChangeStorage(e => this.emitDidChangeValue(StorageScope.WORKSPACE, e))); - - await this.workspaceStorage.init(); - -@@ -183,7 +187,18 @@ export class BrowserStorageService extends AbstractStorageService { - } - - protected async switchToWorkspace(toWorkspace: IAnyWorkspaceIdentifier, preserveData: boolean): Promise { -- throw new Error('Migrating storage is currently unsupported in Web'); -+ const oldWorkspaceStorage = assertIsDefined(this.workspaceStorage); -+ const oldItems = preserveData ? oldWorkspaceStorage.items : new Map(); -+ -+ // Close old workpace storage -+ await oldWorkspaceStorage.close(); -+ this.workspace = toWorkspace; -+ -+ // Create new workspace storage & init -+ await this.createWorkspaceStorage(); -+ -+ // Handle data switch and eventing -+ this.switchData(oldItems, assertIsDefined(this.workspaceStorage), StorageScope.WORKSPACE); - } - - protected override shouldFlushWhenIdle(): boolean { diff --git a/vscode-paches/0038-cleanup-remove-code-that-we-will-run-ourselves.patch b/vscode-paches/0038-cleanup-remove-code-that-we-will-run-ourselves.patch deleted file mode 100644 index 46ec4046..00000000 --- a/vscode-paches/0038-cleanup-remove-code-that-we-will-run-ourselves.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:26:35 +0100 -Subject: [PATCH] cleanup: remove code that we will run ourselves - ---- - src/vs/workbench/browser/workbench.ts | 20 -------------------- - 1 file changed, 20 deletions(-) - -diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts -index cf237f2df62..ca295f38ddb 100644 ---- a/src/vs/workbench/browser/workbench.ts -+++ b/src/vs/workbench/browser/workbench.ts -@@ -11,10 +11,7 @@ import { RunOnceScheduler, timeout } from '../../base/common/async.js'; - import { isFirefox, isSafari, isChrome } from '../../base/browser/browser.js'; - import { mark } from '../../base/common/performance.js'; - import { onUnexpectedError, setUnexpectedErrorHandler } from '../../base/common/errors.js'; --import { Registry } from '../../platform/registry/common/platform.js'; - import { isWindows, isLinux, isWeb, isNative, isMacintosh } from '../../base/common/platform.js'; --import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from '../common/contributions.js'; --import { IEditorFactoryRegistry, EditorExtensions } from '../common/editor.js'; - import { getSingletonServiceDescriptors } from '../../platform/instantiation/common/extensions.js'; - import { Position, Parts, IWorkbenchLayoutService, positionToString } from '../services/layout/browser/layoutService.js'; - import { IStorageService, WillSaveStateReason, StorageScope, StorageTarget } from '../../platform/storage/common/storage.js'; -@@ -35,7 +32,6 @@ import { FontMeasurements } from '../../editor/browser/config/fontMeasurements.j - import { BareFontInfo } from '../../editor/common/config/fontInfo.js'; - import { ILogService } from '../../platform/log/common/log.js'; - import { toErrorMessage } from '../../base/common/errorMessage.js'; --import { WorkbenchContextKeysHandler } from './contextkeys.js'; - import { coalesce } from '../../base/common/arrays.js'; - import { InstantiationService } from '../../platform/instantiation/common/instantiationService.js'; - import { Layout } from './layout.js'; -@@ -43,9 +39,6 @@ import { IHostService } from '../services/host/browser/host.js'; - import { IDialogService } from '../../platform/dialogs/common/dialogs.js'; - import { mainWindow } from '../../base/browser/window.js'; - import { PixelRatio } from '../../base/browser/pixelRatio.js'; --import { IHoverService, WorkbenchHoverDelegate } from '../../platform/hover/browser/hover.js'; --import { setHoverDelegateFactory } from '../../base/browser/ui/hover/hoverDelegateFactory.js'; --import { setBaseLayerHoverDelegate } from '../../base/browser/ui/hover/hoverDelegate2.js'; - import { AccessibilityProgressSignalScheduler } from '../../platform/accessibilitySignal/browser/progressAccessibilitySignalScheduler.js'; - import { setProgressAcccessibilitySignalScheduler } from '../../base/browser/ui/progressbar/progressAccessibilitySignal.js'; - import { AccessibleViewRegistry } from '../../platform/accessibility/browser/accessibleViewRegistry.js'; -@@ -158,25 +151,12 @@ export class Workbench extends Layout { - const storageService = accessor.get(IStorageService); - const configurationService = accessor.get(IConfigurationService); - const hostService = accessor.get(IHostService); -- const hoverService = accessor.get(IHoverService); - const dialogService = accessor.get(IDialogService); - const notificationService = accessor.get(INotificationService) as NotificationService; - -- // Default Hover Delegate must be registered before creating any workbench/layout components -- // as these possibly will use the default hover delegate -- setHoverDelegateFactory((placement, enableInstantHover) => instantiationService.createInstance(WorkbenchHoverDelegate, placement, enableInstantHover, {})); -- setBaseLayerHoverDelegate(hoverService); -- - // Layout - this.initLayout(accessor); - -- // Registries -- Registry.as(WorkbenchExtensions.Workbench).start(accessor); -- Registry.as(EditorExtensions.EditorFactory).start(accessor); -- -- // Context Keys -- this._register(instantiationService.createInstance(WorkbenchContextKeysHandler)); -- - // Register Listeners - this.registerListeners(lifecycleService, storageService, configurationService, hostService, dialogService); - diff --git a/vscode-paches/0039-fix-typescript-use-import-function-able-to-replace-i.patch b/vscode-paches/0039-fix-typescript-use-import-function-able-to-replace-i.patch deleted file mode 100644 index 7dc6b37f..00000000 --- a/vscode-paches/0039-fix-typescript-use-import-function-able-to-replace-i.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 18:27:13 +0100 -Subject: [PATCH] fix(typescript): use import function able to replace imported - url - ---- - extensions/typescript-language-features/web/src/serverHost.ts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/extensions/typescript-language-features/web/src/serverHost.ts b/extensions/typescript-language-features/web/src/serverHost.ts -index dedec85991f..dafc7f009a1 100644 ---- a/extensions/typescript-language-features/web/src/serverHost.ts -+++ b/extensions/typescript-language-features/web/src/serverHost.ts -@@ -89,7 +89,7 @@ function createServerHost( - - const scriptPath = combinePaths(packageRoot, browser); - try { -- const { default: module } = await import(/* webpackIgnore: true */ scriptPath); -+ const { default: module } = await new Function('url', 'return importExt(url)')(scriptPath); - return { module, error: undefined }; - } catch (e) { - return { module: undefined, error: e }; diff --git a/vscode-paches/0040-feat-add-a-way-to-detect-if-localization-were-alread.patch b/vscode-paches/0040-feat-add-a-way-to-detect-if-localization-were-alread.patch deleted file mode 100644 index 1e11f5f8..00000000 --- a/vscode-paches/0040-feat-add-a-way-to-detect-if-localization-were-alread.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Tue, 12 Mar 2024 17:03:08 +0100 -Subject: [PATCH] feat: add a way to detect if localization were already used - ---- - src/vs/nls.ts | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/vs/nls.ts b/src/vs/nls.ts -index e730d0a761e..0c14d36a40e 100644 ---- a/src/vs/nls.ts -+++ b/src/vs/nls.ts -@@ -47,6 +47,12 @@ function _format(message: string, args: (string | number | boolean | undefined | - return result; - } - -+let initialized = false; -+ -+export function isInitialized() { -+ return initialized; -+} -+ - /** - * Marks a string to be localized. Returns the localized string. - * -@@ -91,6 +97,7 @@ export function localize(data: ILocalizeInfo | string /* | number when built */, - * depending on the target context. - */ - function lookupMessage(index: number, fallback: string | null): string { -+ initialized = true; - const message = getNLSMessages()?.[index]; - if (typeof message !== 'string') { - if (typeof fallback === 'string') { diff --git a/vscode-paches/0041-fix-move-action-from-service-file-to-contribution.patch b/vscode-paches/0041-fix-move-action-from-service-file-to-contribution.patch deleted file mode 100644 index 2d5829c8..00000000 --- a/vscode-paches/0041-fix-move-action-from-service-file-to-contribution.patch +++ /dev/null @@ -1,160 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 15 Apr 2024 10:52:20 +0200 -Subject: [PATCH] fix: move action from service file to contribution - ---- - .../browser/gettingStarted.contribution.ts | 1 + - .../gettingStartedService._contribution.ts | 55 +++++++++++++++++++ - .../browser/gettingStartedService.ts | 49 +---------------- - 3 files changed, 58 insertions(+), 47 deletions(-) - create mode 100644 src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService._contribution.ts - -diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts -index e5b58995fd2..8ef9e2becc0 100644 ---- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts -+++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts -@@ -33,6 +33,7 @@ import { Categories } from '../../../../platform/action/common/actionCommonCateg - import { DisposableStore } from '../../../../base/common/lifecycle.js'; - import { AccessibleViewRegistry } from '../../../../platform/accessibility/browser/accessibleViewRegistry.js'; - import { GettingStartedAccessibleView } from './gettingStartedAccessibleView.js'; -+import 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService._contribution.js'; - - export * as icons from './gettingStartedIcons.js'; - -diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService._contribution.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService._contribution.ts -new file mode 100644 -index 00000000000..3fc81fe28fc ---- /dev/null -+++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService._contribution.ts -@@ -0,0 +1,55 @@ -+/*--------------------------------------------------------------------------------------------- -+ * Copyright (c) Microsoft Corporation. All rights reserved. -+ * Licensed under the MIT License. See License.txt in the project root for license information. -+ *--------------------------------------------------------------------------------------------*/ -+ -+import { localize2 } from 'vs/nls'; -+import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; -+import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -+import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -+import { Memento } from 'vs/workbench/common/memento'; -+import { hiddenEntriesConfigurationKey, IWalkthroughsService, walkthroughMetadataConfigurationKey } from 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService'; -+ -+registerAction2(class extends Action2 { -+ constructor() { -+ super({ -+ id: 'resetGettingStartedProgress', -+ category: localize2('developer', "Developer"), -+ title: localize2('resetWelcomePageWalkthroughProgress', "Reset Welcome Page Walkthrough Progress"), -+ f1: true, -+ metadata: { -+ description: localize2('resetGettingStartedProgressDescription', 'Reset the progress of all Walkthrough steps on the Welcome Page to make them appear as if they are being viewed for the first time, providing a fresh start to the getting started experience.'), -+ } -+ }); -+ } -+ -+ run(accessor: ServicesAccessor) { -+ const gettingStartedService = accessor.get(IWalkthroughsService); -+ const storageService = accessor.get(IStorageService); -+ -+ storageService.store( -+ hiddenEntriesConfigurationKey, -+ JSON.stringify([]), -+ StorageScope.PROFILE, -+ StorageTarget.USER); -+ -+ storageService.store( -+ walkthroughMetadataConfigurationKey, -+ JSON.stringify([]), -+ StorageScope.PROFILE, -+ StorageTarget.USER); -+ -+ const memento = new Memento('gettingStartedService', accessor.get(IStorageService)); -+ const record = memento.getMemento(StorageScope.PROFILE, StorageTarget.USER); -+ for (const key in record) { -+ if (Object.prototype.hasOwnProperty.call(record, key)) { -+ try { -+ gettingStartedService.deprogressStep(key); -+ } catch (e) { -+ console.error(e); -+ } -+ } -+ } -+ memento.saveMemento(); -+ } -+}); -diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts -index 310fd38c68f..0d7b7a10e1c 100644 ---- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts -+++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts -@@ -3,11 +3,10 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - --import { createDecorator, IInstantiationService, ServicesAccessor } from '../../../../platform/instantiation/common/instantiation.js'; -+import { createDecorator, IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; - import { Emitter, Event } from '../../../../base/common/event.js'; - import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js'; - import { Memento } from '../../../common/memento.js'; --import { Action2, registerAction2 } from '../../../../platform/actions/common/actions.js'; - import { ICommandService } from '../../../../platform/commands/common/commands.js'; - import { ContextKeyExpr, ContextKeyExpression, IContextKeyService, RawContextKey } from '../../../../platform/contextkey/common/contextkey.js'; - import { Disposable } from '../../../../base/common/lifecycle.js'; -@@ -28,7 +27,7 @@ import { InstantiationType, registerSingleton } from '../../../../platform/insta - import { dirname } from '../../../../base/common/path.js'; - import { coalesce } from '../../../../base/common/arrays.js'; - import { IViewsService } from '../../../services/views/common/viewsService.js'; --import { localize, localize2 } from '../../../../nls.js'; -+import { localize } from '../../../../nls.js'; - import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; - import { checkGlobFileExists } from '../../../services/extensions/common/workspaceContains.js'; - import { IWorkspaceContextService } from '../../../../platform/workspace/common/workspace.js'; -@@ -668,48 +667,4 @@ const convertInternalMediaPathsToBrowserURIs = (path: string | { hc: string; hcL - } - }; - --registerAction2(class extends Action2 { -- constructor() { -- super({ -- id: 'resetGettingStartedProgress', -- category: localize2('developer', "Developer"), -- title: localize2('resetWelcomePageWalkthroughProgress', "Reset Welcome Page Walkthrough Progress"), -- f1: true, -- metadata: { -- description: localize2('resetGettingStartedProgressDescription', 'Reset the progress of all Walkthrough steps on the Welcome Page to make them appear as if they are being viewed for the first time, providing a fresh start to the getting started experience.'), -- } -- }); -- } -- -- run(accessor: ServicesAccessor) { -- const gettingStartedService = accessor.get(IWalkthroughsService); -- const storageService = accessor.get(IStorageService); -- -- storageService.store( -- hiddenEntriesConfigurationKey, -- JSON.stringify([]), -- StorageScope.PROFILE, -- StorageTarget.USER); -- -- storageService.store( -- walkthroughMetadataConfigurationKey, -- JSON.stringify([]), -- StorageScope.PROFILE, -- StorageTarget.USER); -- -- const memento = new Memento('gettingStartedService', accessor.get(IStorageService)); -- const record = memento.getMemento(StorageScope.PROFILE, StorageTarget.USER); -- for (const key in record) { -- if (Object.prototype.hasOwnProperty.call(record, key)) { -- try { -- gettingStartedService.deprogressStep(key); -- } catch (e) { -- console.error(e); -- } -- } -- } -- memento.saveMemento(); -- } --}); -- - registerSingleton(IWalkthroughsService, WalkthroughsService, InstantiationType.Delayed); diff --git a/vscode-paches/0042-refactor-split-workbench-contribution.patch b/vscode-paches/0042-refactor-split-workbench-contribution.patch deleted file mode 100644 index 4d16a13a..00000000 --- a/vscode-paches/0042-refactor-split-workbench-contribution.patch +++ /dev/null @@ -1,271 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Tue, 16 Apr 2024 15:06:48 +0200 -Subject: [PATCH] refactor: split workbench contribution - ---- - .../api/browser/extensionHost.contribution.ts | 30 ------------------- - .../api/browser/statusBarExtensionPoint.ts | 16 +++++++++- - .../common/jsonValidationExtensionPoint.ts | 15 ++++++++++ - .../languageConfigurationExtensionPoint.ts | 15 ++++++++++ - .../themes/common/colorExtensionPoint.ts | 15 ++++++++++ - .../themes/common/iconExtensionPoint.ts | 15 ++++++++++ - .../tokenClassificationExtensionPoint.ts | 12 ++++++++ - src/vs/workbench/workbench.common.main.ts | 12 ++++++-- - 8 files changed, 96 insertions(+), 34 deletions(-) - -diff --git a/src/vs/workbench/api/browser/extensionHost.contribution.ts b/src/vs/workbench/api/browser/extensionHost.contribution.ts -index 2764905f82f..342930c504d 100644 ---- a/src/vs/workbench/api/browser/extensionHost.contribution.ts -+++ b/src/vs/workbench/api/browser/extensionHost.contribution.ts -@@ -3,17 +3,6 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - --import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from '../../common/contributions.js'; --import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; -- --// --- other interested parties --import { JSONValidationExtensionPoint } from '../common/jsonValidationExtensionPoint.js'; --import { ColorExtensionPoint } from '../../services/themes/common/colorExtensionPoint.js'; --import { IconExtensionPoint } from '../../services/themes/common/iconExtensionPoint.js'; --import { TokenClassificationExtensionPoints } from '../../services/themes/common/tokenClassificationExtensionPoint.js'; --import { LanguageConfigurationFileHandler } from '../../contrib/codeEditor/common/languageConfigurationExtensionPoint.js'; --import { StatusBarItemsExtensionPoint } from './statusBarExtensionPoint.js'; -- - // --- mainThread participants - import './mainThreadLocalization.js'; - import './mainThreadBulkEdits.js'; -@@ -89,22 +78,3 @@ import './mainThreadShare.js'; - import './mainThreadProfileContentHandlers.js'; - import './mainThreadAiRelatedInformation.js'; - import './mainThreadAiEmbeddingVector.js'; -- --export class ExtensionPoints implements IWorkbenchContribution { -- -- static readonly ID = 'workbench.contrib.extensionPoints'; -- -- constructor( -- @IInstantiationService private readonly instantiationService: IInstantiationService -- ) { -- // Classes that handle extension points... -- this.instantiationService.createInstance(JSONValidationExtensionPoint); -- this.instantiationService.createInstance(ColorExtensionPoint); -- this.instantiationService.createInstance(IconExtensionPoint); -- this.instantiationService.createInstance(TokenClassificationExtensionPoints); -- this.instantiationService.createInstance(LanguageConfigurationFileHandler); -- this.instantiationService.createInstance(StatusBarItemsExtensionPoint); -- } --} -- --registerWorkbenchContribution2(ExtensionPoints.ID, ExtensionPoints, WorkbenchPhase.BlockStartup); -diff --git a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts b/src/vs/workbench/api/browser/statusBarExtensionPoint.ts -index 022b7ff6e54..9e5c057b1fe 100644 ---- a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts -+++ b/src/vs/workbench/api/browser/statusBarExtensionPoint.ts -@@ -6,7 +6,7 @@ - import { IJSONSchema } from '../../../base/common/jsonSchema.js'; - import { DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; - import { localize } from '../../../nls.js'; --import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; -+import { createDecorator, IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; - import { isProposedApiEnabled } from '../../services/extensions/common/extensions.js'; - import { ExtensionsRegistry } from '../../services/extensions/common/extensionsRegistry.js'; - import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment, IStatusbarEntryAccessor, IStatusbarEntry, StatusbarAlignment, IStatusbarEntryPriority, StatusbarEntryKind } from '../../services/statusbar/browser/statusbar.js'; -@@ -22,6 +22,7 @@ import { Iterable } from '../../../base/common/iterator.js'; - import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; - import { asStatusBarItemIdentifier } from '../common/extHostTypes.js'; - import { STATUS_BAR_ERROR_ITEM_BACKGROUND, STATUS_BAR_WARNING_ITEM_BACKGROUND } from '../../common/theme.js'; -+import { IWorkbenchContribution, registerWorkbenchContribution2 } from '../../common/contributions.js'; - - - // --- service -@@ -307,3 +308,16 @@ export class StatusBarItemsExtensionPoint { - }); - } - } -+ -+class StatusBarItemsExtensionPointWorkbenchContribution implements IWorkbenchContribution { -+ -+ static readonly ID = 'workbench.contrib.statusBarItemsExtensionPoint'; -+ -+ constructor( -+ @IInstantiationService private readonly instantiationService: IInstantiationService -+ ) { -+ this.instantiationService.createInstance(StatusBarItemsExtensionPoint); -+ } -+} -+ -+registerWorkbenchContribution2(StatusBarItemsExtensionPointWorkbenchContribution.ID, StatusBarItemsExtensionPointWorkbenchContribution, WorkbenchPhase.BlockStartup); -diff --git a/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts b/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts -index 24559bee3f8..574f4f8cb44 100644 ---- a/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts -+++ b/src/vs/workbench/api/common/jsonValidationExtensionPoint.ts -@@ -13,6 +13,8 @@ import { IExtensionManifest } from '../../../platform/extensions/common/extensio - import { Registry } from '../../../platform/registry/common/platform.js'; - import { SyncDescriptor } from '../../../platform/instantiation/common/descriptors.js'; - import { MarkdownString } from '../../../base/common/htmlContent.js'; -+import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../common/contributions.js'; -+import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; - - interface IJSONValidationExtensionPoint { - fileMatch: string | string[]; -@@ -133,3 +135,16 @@ Registry.as(Extensions.ExtensionFeaturesRegistry).re - }, - renderer: new SyncDescriptor(JSONValidationDataRenderer), - }); -+ -+class JSONValidationExtensionPointWorkbenchContribution implements IWorkbenchContribution { -+ -+ static readonly ID = 'workbench.contrib.jsonValidationExtensionPoint'; -+ -+ constructor( -+ @IInstantiationService private readonly instantiationService: IInstantiationService -+ ) { -+ this.instantiationService.createInstance(JSONValidationExtensionPoint); -+ } -+} -+ -+registerWorkbenchContribution2(JSONValidationExtensionPointWorkbenchContribution.ID, JSONValidationExtensionPointWorkbenchContribution, WorkbenchPhase.BlockStartup); -diff --git a/src/vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint.ts b/src/vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint.ts -index 80aa77d2019..9af7e9a1e4a 100644 ---- a/src/vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint.ts -+++ b/src/vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint.ts -@@ -18,6 +18,8 @@ import { getParseErrorMessage } from '../../../../base/common/jsonErrorMessages. - import { IExtensionResourceLoaderService } from '../../../../platform/extensionResourceLoader/common/extensionResourceLoader.js'; - import { hash } from '../../../../base/common/hash.js'; - import { Disposable } from '../../../../base/common/lifecycle.js'; -+import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../../common/contributions.js'; -+import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; - - interface IRegExp { - pattern: string; -@@ -834,3 +836,16 @@ const schema: IJSONSchema = { - }; - const schemaRegistry = Registry.as(Extensions.JSONContribution); - schemaRegistry.registerSchema(schemaId, schema); -+ -+class LanguageConfigurationWorkbenchContribution implements IWorkbenchContribution { -+ -+ static readonly ID = 'workbench.contrib.languageConfigurationExtensionPoint'; -+ -+ constructor( -+ @IInstantiationService private readonly instantiationService: IInstantiationService -+ ) { -+ this.instantiationService.createInstance(LanguageConfigurationFileHandler); -+ } -+} -+ -+registerWorkbenchContribution2(LanguageConfigurationWorkbenchContribution.ID, LanguageConfigurationWorkbenchContribution, WorkbenchPhase.BlockStartup); -diff --git a/src/vs/workbench/services/themes/common/colorExtensionPoint.ts b/src/vs/workbench/services/themes/common/colorExtensionPoint.ts -index b392cc8614f..bc4df0624f8 100644 ---- a/src/vs/workbench/services/themes/common/colorExtensionPoint.ts -+++ b/src/vs/workbench/services/themes/common/colorExtensionPoint.ts -@@ -13,6 +13,8 @@ import { Extensions, IExtensionFeatureTableRenderer, IExtensionFeaturesRegistry, - import { SyncDescriptor } from '../../../../platform/instantiation/common/descriptors.js'; - import { IExtensionManifest } from '../../../../platform/extensions/common/extensions.js'; - import { MarkdownString } from '../../../../base/common/htmlContent.js'; -+import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../../common/contributions.js'; -+import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; - - interface IColorExtensionPoint { - id: string; -@@ -208,3 +210,16 @@ Registry.as(Extensions.ExtensionFeaturesRegistry).re - }, - renderer: new SyncDescriptor(ColorDataRenderer), - }); -+ -+class ColorExtensionPointWorkbenchContribution implements IWorkbenchContribution { -+ -+ static readonly ID = 'workbench.contrib.colorExtensionPoint'; -+ -+ constructor( -+ @IInstantiationService private readonly instantiationService: IInstantiationService -+ ) { -+ this.instantiationService.createInstance(ColorExtensionPoint); -+ } -+} -+ -+registerWorkbenchContribution2(ColorExtensionPointWorkbenchContribution.ID, ColorExtensionPointWorkbenchContribution, WorkbenchPhase.BlockStartup); -diff --git a/src/vs/workbench/services/themes/common/iconExtensionPoint.ts b/src/vs/workbench/services/themes/common/iconExtensionPoint.ts -index 29588b66234..798300c0efd 100644 ---- a/src/vs/workbench/services/themes/common/iconExtensionPoint.ts -+++ b/src/vs/workbench/services/themes/common/iconExtensionPoint.ts -@@ -11,6 +11,8 @@ import { ThemeIcon } from '../../../../base/common/themables.js'; - import * as resources from '../../../../base/common/resources.js'; - import { IExtensionDescription } from '../../../../platform/extensions/common/extensions.js'; - import { extname, posix } from '../../../../base/common/path.js'; -+import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../../common/contributions.js'; -+import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; - - interface IIconExtensionPoint { - [id: string]: { -@@ -142,3 +144,16 @@ const formatMap: Record = { - function getFontId(description: IExtensionDescription, fontPath: string) { - return posix.join(description.identifier.value, fontPath); - } -+ -+class ColorExtensionPointWorkbenchContribution implements IWorkbenchContribution { -+ -+ static readonly ID = 'workbench.contrib.iconExtensionPoint'; -+ -+ constructor( -+ @IInstantiationService private readonly instantiationService: IInstantiationService -+ ) { -+ this.instantiationService.createInstance(IconExtensionPoint); -+ } -+} -+ -+registerWorkbenchContribution2(ColorExtensionPointWorkbenchContribution.ID, ColorExtensionPointWorkbenchContribution, WorkbenchPhase.BlockStartup); -diff --git a/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts b/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts -index d78e65afc3f..56bd057fb3e 100644 ---- a/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts -+++ b/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts -@@ -6,6 +6,8 @@ - import * as nls from '../../../../nls.js'; - import { ExtensionsRegistry, ExtensionMessageCollector } from '../../extensions/common/extensionsRegistry.js'; - import { getTokenClassificationRegistry, ITokenClassificationRegistry, typeAndModifierIdPattern } from '../../../../platform/theme/common/tokenClassificationRegistry.js'; -+import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../../common/contributions.js'; -+import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js'; - - interface ITokenTypeExtensionPoint { - id: string; -@@ -225,5 +227,15 @@ export class TokenClassificationExtensionPoints { - } - } - -+class TokenClassificationExtensionPointWorkbenchContribution implements IWorkbenchContribution { - -+ static readonly ID = 'workbench.contrib.tokenClassificationExtensionPoint'; - -+ constructor( -+ @IInstantiationService private readonly instantiationService: IInstantiationService -+ ) { -+ this.instantiationService.createInstance(TokenClassificationExtensionPoints); -+ } -+} -+ -+registerWorkbenchContribution2(TokenClassificationExtensionPointWorkbenchContribution.ID, TokenClassificationExtensionPointWorkbenchContribution, WorkbenchPhase.BlockStartup); -diff --git a/src/vs/workbench/workbench.common.main.ts b/src/vs/workbench/workbench.common.main.ts -index 285fea2c50e..490e6ebae78 100644 ---- a/src/vs/workbench/workbench.common.main.ts -+++ b/src/vs/workbench/workbench.common.main.ts -@@ -32,9 +32,15 @@ import './browser/actions/widgetNavigationCommands.js'; - - //#region --- API Extension Points - --import './services/actions/common/menusExtensionPoint.js'; --import './api/common/configurationExtensionPoint.js'; --import './api/browser/viewsExtensionPoint.js'; -+import 'vs/workbench/services/actions/common/menusExtensionPoint.js'; -+import 'vs/workbench/api/common/configurationExtensionPoint.js'; -+import 'vs/workbench/api/browser/viewsExtensionPoint.js'; -+import 'vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint.js'; -+import 'vs/workbench/api/common/jsonValidationExtensionPoint.js'; -+import 'vs/workbench/services/themes/common/colorExtensionPoint.js'; -+import 'vs/workbench/services/themes/common/iconExtensionPoint.js'; -+import 'vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js'; -+import 'vs/workbench/api/browser/statusBarExtensionPoint.js'; - - //#endregion - diff --git a/vscode-paches/0043-refactor-split-service-and-extension-point.patch b/vscode-paches/0043-refactor-split-service-and-extension-point.patch deleted file mode 100644 index 563c6406..00000000 --- a/vscode-paches/0043-refactor-split-service-and-extension-point.patch +++ /dev/null @@ -1,371 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Tue, 16 Apr 2024 15:13:41 +0200 -Subject: [PATCH] refactor: split service and extension point - ---- - .../api/browser/mainThreadStatusBar.ts | 2 +- - .../api/browser/statusBarExtensionPoint.ts | 160 +----------------- - .../workbench/api/browser/statusBarService.ts | 159 +++++++++++++++++ - 3 files changed, 164 insertions(+), 157 deletions(-) - create mode 100644 src/vs/workbench/api/browser/statusBarService.ts - -diff --git a/src/vs/workbench/api/browser/mainThreadStatusBar.ts b/src/vs/workbench/api/browser/mainThreadStatusBar.ts -index 4988e519f39..d57f2ada2ba 100644 ---- a/src/vs/workbench/api/browser/mainThreadStatusBar.ts -+++ b/src/vs/workbench/api/browser/mainThreadStatusBar.ts -@@ -10,8 +10,8 @@ import { DisposableStore, toDisposable } from '../../../base/common/lifecycle.js - import { Command } from '../../../editor/common/languages.js'; - import { IAccessibilityInformation } from '../../../platform/accessibility/common/accessibility.js'; - import { IMarkdownString } from '../../../base/common/htmlContent.js'; --import { IExtensionStatusBarItemService, StatusBarUpdateKind } from './statusBarExtensionPoint.js'; - import { IStatusbarEntry, StatusbarAlignment } from '../../services/statusbar/browser/statusbar.js'; -+import { IExtensionStatusBarItemService, StatusBarUpdateKind } from './statusBarService.js'; - - @extHostNamedCustomer(MainContext.MainThreadStatusBar) - export class MainThreadStatusBar implements MainThreadStatusBarShape { -diff --git a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts b/src/vs/workbench/api/browser/statusBarExtensionPoint.ts -index 9e5c057b1fe..695a7c69617 100644 ---- a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts -+++ b/src/vs/workbench/api/browser/statusBarExtensionPoint.ts -@@ -4,171 +4,19 @@ - *--------------------------------------------------------------------------------------------*/ - - import { IJSONSchema } from '../../../base/common/jsonSchema.js'; --import { DisposableStore, IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; -+import { DisposableStore, toDisposable } from '../../../base/common/lifecycle.js'; - import { localize } from '../../../nls.js'; --import { createDecorator, IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; -+import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; - import { isProposedApiEnabled } from '../../services/extensions/common/extensions.js'; - import { ExtensionsRegistry } from '../../services/extensions/common/extensionsRegistry.js'; --import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment, IStatusbarEntryAccessor, IStatusbarEntry, StatusbarAlignment, IStatusbarEntryPriority, StatusbarEntryKind } from '../../services/statusbar/browser/statusbar.js'; --import { ThemeColor } from '../../../base/common/themables.js'; --import { Command } from '../../../editor/common/languages.js'; - import { IAccessibilityInformation, isAccessibilityInformation } from '../../../platform/accessibility/common/accessibility.js'; --import { IMarkdownString } from '../../../base/common/htmlContent.js'; --import { getCodiconAriaLabel } from '../../../base/common/iconLabels.js'; --import { hash } from '../../../base/common/hash.js'; --import { Event, Emitter } from '../../../base/common/event.js'; --import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; - import { Iterable } from '../../../base/common/iterator.js'; - import { ExtensionIdentifier } from '../../../platform/extensions/common/extensions.js'; - import { asStatusBarItemIdentifier } from '../common/extHostTypes.js'; --import { STATUS_BAR_ERROR_ITEM_BACKGROUND, STATUS_BAR_WARNING_ITEM_BACKGROUND } from '../../common/theme.js'; --import { IWorkbenchContribution, registerWorkbenchContribution2 } from '../../common/contributions.js'; -+import { IWorkbenchContribution, registerWorkbenchContribution2, WorkbenchPhase } from '../../common/contributions.js'; -+import { IExtensionStatusBarItemService, StatusBarUpdateKind } from './statusBarService.js'; - - --// --- service -- --export const IExtensionStatusBarItemService = createDecorator('IExtensionStatusBarItemService'); -- --export interface IExtensionStatusBarItemChangeEvent { -- readonly added?: ExtensionStatusBarEntry; -- readonly removed?: string; --} -- --export type ExtensionStatusBarEntry = [string, { -- entry: IStatusbarEntry; -- alignment: MainThreadStatusBarAlignment; -- priority: number; --}]; -- --export const enum StatusBarUpdateKind { -- DidDefine, -- DidUpdate --} -- --export interface IExtensionStatusBarItemService { -- readonly _serviceBrand: undefined; -- -- onDidChange: Event; -- -- setOrUpdateEntry(id: string, statusId: string, extensionId: string | undefined, name: string, text: string, tooltip: IMarkdownString | string | undefined, command: Command | undefined, color: string | ThemeColor | undefined, backgroundColor: ThemeColor | undefined, alignLeft: boolean, priority: number | undefined, accessibilityInformation: IAccessibilityInformation | undefined): StatusBarUpdateKind; -- -- unsetEntry(id: string): void; -- -- getEntries(): Iterable; --} -- -- --export class ExtensionStatusBarItemService implements IExtensionStatusBarItemService { -- -- declare readonly _serviceBrand: undefined; -- -- private readonly _entries: Map = new Map(); -- -- private readonly _onDidChange = new Emitter(); -- readonly onDidChange: Event = this._onDidChange.event; -- -- constructor(@IStatusbarService private readonly _statusbarService: IStatusbarService) { } -- -- dispose(): void { -- this._entries.forEach(entry => entry.accessor.dispose()); -- this._entries.clear(); -- this._onDidChange.dispose(); -- } -- -- setOrUpdateEntry(entryId: string, -- id: string, extensionId: string | undefined, name: string, text: string, tooltip: IMarkdownString | string | undefined, -- command: Command | undefined, color: string | ThemeColor | undefined, backgroundColor: ThemeColor | undefined, -- alignLeft: boolean, priority: number | undefined, accessibilityInformation: IAccessibilityInformation | undefined -- ): StatusBarUpdateKind { -- // if there are icons in the text use the tooltip for the aria label -- let ariaLabel: string; -- let role: string | undefined = undefined; -- if (accessibilityInformation) { -- ariaLabel = accessibilityInformation.label; -- role = accessibilityInformation.role; -- } else { -- ariaLabel = getCodiconAriaLabel(text); -- if (tooltip) { -- const tooltipString = typeof tooltip === 'string' ? tooltip : tooltip.value; -- ariaLabel += `, ${tooltipString}`; -- } -- } -- let kind: StatusbarEntryKind | undefined = undefined; -- switch (backgroundColor?.id) { -- case STATUS_BAR_ERROR_ITEM_BACKGROUND: -- case STATUS_BAR_WARNING_ITEM_BACKGROUND: -- // override well known colors that map to status entry kinds to support associated themable hover colors -- kind = backgroundColor.id === STATUS_BAR_ERROR_ITEM_BACKGROUND ? 'error' : 'warning'; -- color = undefined; -- backgroundColor = undefined; -- } -- const entry: IStatusbarEntry = { name, text, tooltip, command, color, backgroundColor, ariaLabel, role, kind }; -- -- if (typeof priority === 'undefined') { -- priority = 0; -- } -- -- let alignment = alignLeft ? StatusbarAlignment.LEFT : StatusbarAlignment.RIGHT; -- -- // alignment and priority can only be set once (at creation time) -- const existingEntry = this._entries.get(entryId); -- if (existingEntry) { -- alignment = existingEntry.alignment; -- priority = existingEntry.priority; -- } -- -- // Create new entry if not existing -- if (!existingEntry) { -- let entryPriority: number | IStatusbarEntryPriority; -- if (typeof extensionId === 'string') { -- // We cannot enforce unique priorities across all extensions, so we -- // use the extension identifier as a secondary sort key to reduce -- // the likelyhood of collisions. -- // See https://github.com/microsoft/vscode/issues/177835 -- // See https://github.com/microsoft/vscode/issues/123827 -- entryPriority = { primary: priority, secondary: hash(extensionId) }; -- } else { -- entryPriority = priority; -- } -- -- const accessor = this._statusbarService.addEntry(entry, id, alignment, entryPriority); -- this._entries.set(entryId, { -- accessor, -- entry, -- alignment, -- priority, -- disposable: toDisposable(() => { -- accessor.dispose(); -- this._entries.delete(entryId); -- this._onDidChange.fire({ removed: entryId }); -- }) -- }); -- -- this._onDidChange.fire({ added: [entryId, { entry, alignment, priority }] }); -- return StatusBarUpdateKind.DidDefine; -- -- } else { -- // Otherwise update -- existingEntry.accessor.update(entry); -- existingEntry.entry = entry; -- return StatusBarUpdateKind.DidUpdate; -- } -- } -- -- unsetEntry(entryId: string): void { -- this._entries.get(entryId)?.disposable.dispose(); -- this._entries.delete(entryId); -- } -- -- getEntries(): Iterable<[string, { entry: IStatusbarEntry; alignment: MainThreadStatusBarAlignment; priority: number }]> { -- return this._entries.entries(); -- } --} -- --registerSingleton(IExtensionStatusBarItemService, ExtensionStatusBarItemService, InstantiationType.Delayed); -- --// --- extension point and reading of it -- - interface IUserFriendlyStatusItemEntry { - id: string; - name: string; -diff --git a/src/vs/workbench/api/browser/statusBarService.ts b/src/vs/workbench/api/browser/statusBarService.ts -new file mode 100644 -index 00000000000..2dcf5005a86 ---- /dev/null -+++ b/src/vs/workbench/api/browser/statusBarService.ts -@@ -0,0 +1,159 @@ -+/*--------------------------------------------------------------------------------------------- -+ * Copyright (c) Microsoft Corporation. All rights reserved. -+ * Licensed under the MIT License. See License.txt in the project root for license information. -+ *--------------------------------------------------------------------------------------------*/ -+ -+import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js'; -+import { createDecorator } from '../../../platform/instantiation/common/instantiation.js'; -+import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment, IStatusbarEntryAccessor, IStatusbarEntry, StatusbarAlignment, IStatusbarEntryPriority, StatusbarEntryKind } from '../../services/statusbar/browser/statusbar.js'; -+import { ThemeColor } from '../../../base/common/themables.js'; -+import { Command } from '../../../editor/common/languages.js'; -+import { IAccessibilityInformation } from '../../../platform/accessibility/common/accessibility.js'; -+import { IMarkdownString } from '../../../base/common/htmlContent.js'; -+import { getCodiconAriaLabel } from '../../../base/common/iconLabels.js'; -+import { hash } from '../../../base/common/hash.js'; -+import { Event, Emitter } from '../../../base/common/event.js'; -+import { InstantiationType, registerSingleton } from '../../../platform/instantiation/common/extensions.js'; -+import { STATUS_BAR_ERROR_ITEM_BACKGROUND, STATUS_BAR_WARNING_ITEM_BACKGROUND } from '../../common/theme.js'; -+ -+// --- service -+ -+export const IExtensionStatusBarItemService = createDecorator('IExtensionStatusBarItemService'); -+ -+export interface IExtensionStatusBarItemChangeEvent { -+ readonly added?: ExtensionStatusBarEntry; -+ readonly removed?: string; -+} -+ -+export type ExtensionStatusBarEntry = [string, { -+ entry: IStatusbarEntry; -+ alignment: MainThreadStatusBarAlignment; -+ priority: number; -+}]; -+ -+export const enum StatusBarUpdateKind { -+ DidDefine, -+ DidUpdate -+} -+ -+export interface IExtensionStatusBarItemService { -+ readonly _serviceBrand: undefined; -+ -+ onDidChange: Event; -+ -+ setOrUpdateEntry(id: string, statusId: string, extensionId: string | undefined, name: string, text: string, tooltip: IMarkdownString | string | undefined, command: Command | undefined, color: string | ThemeColor | undefined, backgroundColor: ThemeColor | undefined, alignLeft: boolean, priority: number | undefined, accessibilityInformation: IAccessibilityInformation | undefined): StatusBarUpdateKind; -+ -+ unsetEntry(id: string): void; -+ -+ getEntries(): Iterable; -+} -+ -+ -+export class ExtensionStatusBarItemService implements IExtensionStatusBarItemService { -+ -+ declare readonly _serviceBrand: undefined; -+ -+ private readonly _entries: Map = new Map(); -+ -+ private readonly _onDidChange = new Emitter(); -+ readonly onDidChange: Event = this._onDidChange.event; -+ -+ constructor(@IStatusbarService private readonly _statusbarService: IStatusbarService) { } -+ -+ dispose(): void { -+ this._entries.forEach(entry => entry.accessor.dispose()); -+ this._entries.clear(); -+ this._onDidChange.dispose(); -+ } -+ -+ setOrUpdateEntry(entryId: string, -+ id: string, extensionId: string | undefined, name: string, text: string, tooltip: IMarkdownString | string | undefined, -+ command: Command | undefined, color: string | ThemeColor | undefined, backgroundColor: ThemeColor | undefined, -+ alignLeft: boolean, priority: number | undefined, accessibilityInformation: IAccessibilityInformation | undefined -+ ): StatusBarUpdateKind { -+ // if there are icons in the text use the tooltip for the aria label -+ let ariaLabel: string; -+ let role: string | undefined = undefined; -+ if (accessibilityInformation) { -+ ariaLabel = accessibilityInformation.label; -+ role = accessibilityInformation.role; -+ } else { -+ ariaLabel = getCodiconAriaLabel(text); -+ if (tooltip) { -+ const tooltipString = typeof tooltip === 'string' ? tooltip : tooltip.value; -+ ariaLabel += `, ${tooltipString}`; -+ } -+ } -+ let kind: StatusbarEntryKind | undefined = undefined; -+ switch (backgroundColor?.id) { -+ case STATUS_BAR_ERROR_ITEM_BACKGROUND: -+ case STATUS_BAR_WARNING_ITEM_BACKGROUND: -+ // override well known colors that map to status entry kinds to support associated themable hover colors -+ kind = backgroundColor.id === STATUS_BAR_ERROR_ITEM_BACKGROUND ? 'error' : 'warning'; -+ color = undefined; -+ backgroundColor = undefined; -+ } -+ const entry: IStatusbarEntry = { name, text, tooltip, command, color, backgroundColor, ariaLabel, role, kind }; -+ -+ if (typeof priority === 'undefined') { -+ priority = 0; -+ } -+ -+ let alignment = alignLeft ? StatusbarAlignment.LEFT : StatusbarAlignment.RIGHT; -+ -+ // alignment and priority can only be set once (at creation time) -+ const existingEntry = this._entries.get(entryId); -+ if (existingEntry) { -+ alignment = existingEntry.alignment; -+ priority = existingEntry.priority; -+ } -+ -+ // Create new entry if not existing -+ if (!existingEntry) { -+ let entryPriority: number | IStatusbarEntryPriority; -+ if (typeof extensionId === 'string') { -+ // We cannot enforce unique priorities across all extensions, so we -+ // use the extension identifier as a secondary sort key to reduce -+ // the likelyhood of collisions. -+ // See https://github.com/microsoft/vscode/issues/177835 -+ // See https://github.com/microsoft/vscode/issues/123827 -+ entryPriority = { primary: priority, secondary: hash(extensionId) }; -+ } else { -+ entryPriority = priority; -+ } -+ -+ const accessor = this._statusbarService.addEntry(entry, id, alignment, entryPriority); -+ this._entries.set(entryId, { -+ accessor, -+ entry, -+ alignment, -+ priority, -+ disposable: toDisposable(() => { -+ accessor.dispose(); -+ this._entries.delete(entryId); -+ this._onDidChange.fire({ removed: entryId }); -+ }) -+ }); -+ -+ this._onDidChange.fire({ added: [entryId, { entry, alignment, priority }] }); -+ return StatusBarUpdateKind.DidDefine; -+ -+ } else { -+ // Otherwise update -+ existingEntry.accessor.update(entry); -+ existingEntry.entry = entry; -+ return StatusBarUpdateKind.DidUpdate; -+ } -+ } -+ -+ unsetEntry(entryId: string): void { -+ this._entries.get(entryId)?.disposable.dispose(); -+ this._entries.delete(entryId); -+ } -+ -+ getEntries(): Iterable<[string, { entry: IStatusbarEntry; alignment: MainThreadStatusBarAlignment; priority: number }]> { -+ return this._entries.entries(); -+ } -+} -+ -+registerSingleton(IExtensionStatusBarItemService, ExtensionStatusBarItemService, InstantiationType.Delayed); diff --git a/vscode-paches/0044-fix-weird-syntax.patch b/vscode-paches/0044-fix-weird-syntax.patch deleted file mode 100644 index ee85e1dc..00000000 --- a/vscode-paches/0044-fix-weird-syntax.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Tue, 23 Apr 2024 22:06:54 +0200 -Subject: [PATCH] fix: weird syntax - ---- - src/vs/platform/notification/common/notification.ts | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/src/vs/platform/notification/common/notification.ts b/src/vs/platform/notification/common/notification.ts -index f573e788fb3..2245a1ef63b 100644 ---- a/src/vs/platform/notification/common/notification.ts -+++ b/src/vs/platform/notification/common/notification.ts -@@ -6,10 +6,12 @@ - import { IAction } from '../../../base/common/actions.js'; - import { Event } from '../../../base/common/event.js'; - import { IDisposable } from '../../../base/common/lifecycle.js'; --import BaseSeverity from '../../../base/common/severity.js'; -+import Severity from '../../../base/common/severity.js'; - import { createDecorator } from '../../instantiation/common/instantiation.js'; - --export import Severity = BaseSeverity; -+export { -+ Severity -+}; - - export const INotificationService = createDecorator('notificationService'); - diff --git a/vscode-paches/0045-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch b/vscode-paches/0045-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch deleted file mode 100644 index 2971e75c..00000000 --- a/vscode-paches/0045-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Thu, 25 Apr 2024 18:13:11 +0200 -Subject: [PATCH] fix: do not export stuff from web workbench or the typescript - language service is trying to import from it - ---- - .../browser/treeSitterTokenizationFeature.ts | 2 +- - .../workbench/workbench.web.main.internal.ts | 58 +------------------ - 2 files changed, 2 insertions(+), 58 deletions(-) - -diff --git a/src/vs/workbench/services/treeSitter/browser/treeSitterTokenizationFeature.ts b/src/vs/workbench/services/treeSitter/browser/treeSitterTokenizationFeature.ts -index 9bd32453f1e..1aca8d0cec4 100644 ---- a/src/vs/workbench/services/treeSitter/browser/treeSitterTokenizationFeature.ts -+++ b/src/vs/workbench/services/treeSitter/browser/treeSitterTokenizationFeature.ts -@@ -29,7 +29,7 @@ export interface ITreeSitterTokenizationFeature { - _serviceBrand: undefined; - } - --class TreeSitterTokenizationFeature extends Disposable implements ITreeSitterTokenizationFeature { -+export class TreeSitterTokenizationFeature extends Disposable implements ITreeSitterTokenizationFeature { - public _serviceBrand: undefined; - private readonly _tokenizersRegistrations: DisposableMap = new DisposableMap(); - -diff --git a/src/vs/workbench/workbench.web.main.internal.ts b/src/vs/workbench/workbench.web.main.internal.ts -index 402696a4a83..e87a4db290c 100644 ---- a/src/vs/workbench/workbench.web.main.internal.ts -+++ b/src/vs/workbench/workbench.web.main.internal.ts -@@ -75,7 +75,6 @@ import { IExtensionTipsService } from '../platform/extensionManagement/common/ex - import { ExtensionTipsService } from '../platform/extensionManagement/common/extensionTipsService.js'; - import { IWorkbenchExtensionManagementService } from './services/extensionManagement/common/extensionManagement.js'; - import { ExtensionManagementService } from './services/extensionManagement/common/extensionManagementService.js'; --import { LogLevel } from '../platform/log/common/log.js'; - import { UserDataSyncMachinesService, IUserDataSyncMachinesService } from '../platform/userDataSync/common/userDataSyncMachines.js'; - import { IUserDataSyncStoreService, IUserDataSyncService, IUserDataAutoSyncService, IUserDataSyncLocalStoreService, IUserDataSyncResourceProviderService } from '../platform/userDataSync/common/userDataSync.js'; - import { UserDataSyncStoreService } from '../platform/userDataSync/common/userDataSyncStoreService.js'; -@@ -175,66 +174,11 @@ import './contrib/remote/browser/remoteStartEntry.contribution.js'; - // - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - --import { create, commands, env, window, workspace, logger } from './browser/web.factory.js'; --import { Menu } from './browser/web.api.js'; --import { URI } from '../base/common/uri.js'; --import { Event, Emitter } from '../base/common/event.js'; --import { Disposable } from '../base/common/lifecycle.js'; --import { GroupOrientation } from './services/editor/common/editorGroupsService.js'; -+import { create } from './browser/web.factory.js'; - import { UserDataSyncResourceProviderService } from '../platform/userDataSync/common/userDataSyncResourceProvider.js'; --import { RemoteAuthorityResolverError, RemoteAuthorityResolverErrorCode } from '../platform/remote/common/remoteAuthorityResolver.js'; -- --// TODO@esm remove me once we stop supporting our web-esm-bridge --if ((globalThis as any).__VSCODE_WEB_ESM_PROMISE) { -- const exports = { -- -- // Factory -- create: create, -- -- // Basic Types -- URI: URI, -- Event: Event, -- Emitter: Emitter, -- Disposable: Disposable, -- // GroupOrientation, -- LogLevel: LogLevel, -- RemoteAuthorityResolverError: RemoteAuthorityResolverError, -- RemoteAuthorityResolverErrorCode: RemoteAuthorityResolverErrorCode, -- -- // Facade API -- env: env, -- window: window, -- workspace: workspace, -- commands: commands, -- logger: logger, -- Menu: Menu -- }; -- (globalThis as any).__VSCODE_WEB_ESM_PROMISE(exports); -- delete (globalThis as any).__VSCODE_WEB_ESM_PROMISE; --} - - export { -- -- // Factory - create, -- -- // Basic Types -- URI, -- Event, -- Emitter, -- Disposable, -- GroupOrientation, -- LogLevel, -- RemoteAuthorityResolverError, -- RemoteAuthorityResolverErrorCode, -- -- // Facade API -- env, -- window, -- workspace, -- commands, -- logger, -- Menu - }; - - //#endregion diff --git a/vscode-paches/0046-fix-change-syntax-that-language-service-refactor-doe.patch b/vscode-paches/0046-fix-change-syntax-that-language-service-refactor-doe.patch deleted file mode 100644 index 889417b4..00000000 --- a/vscode-paches/0046-fix-change-syntax-that-language-service-refactor-doe.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Thu, 25 Apr 2024 19:14:25 +0200 -Subject: [PATCH] fix: change syntax that language service refactor doesn't - support well - -the re-exports source are removed during "Move to new file" refactor ---- - src/vs/workbench/contrib/tasks/common/taskService.ts | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/src/vs/workbench/contrib/tasks/common/taskService.ts b/src/vs/workbench/contrib/tasks/common/taskService.ts -index 37cb20ffba3..cc2d2ffd6f0 100644 ---- a/src/vs/workbench/contrib/tasks/common/taskService.ts -+++ b/src/vs/workbench/contrib/tasks/common/taskService.ts -@@ -15,7 +15,9 @@ import { ITaskSummary, ITaskTerminateResponse, ITaskSystemInfo } from './taskSys - import { IStringDictionary } from '../../../../base/common/collections.js'; - import { RawContextKey, ContextKeyExpr } from '../../../../platform/contextkey/common/contextkey.js'; - --export type { ITaskSummary, Task, ITaskTerminateResponse as TaskTerminateResponse }; -+export type { ITaskSummary } from 'vs/workbench/contrib/tasks/common/taskSystem'; -+export type { Task } from 'vs/workbench/contrib/tasks/common/tasks'; -+export type { ITaskTerminateResponse as TaskTerminateResponse } from 'vs/workbench/contrib/tasks/common/taskSystem'; - - export const CustomExecutionSupportedContext = new RawContextKey('customExecutionSupported', false, nls.localize('tasks.customExecutionSupported', "Whether CustomExecution tasks are supported. Consider using in the when clause of a \'taskDefinition\' contribution.")); - export const ShellExecutionSupportedContext = new RawContextKey('shellExecutionSupported', false, nls.localize('tasks.shellExecutionSupported', "Whether ShellExecution tasks are supported. Consider using in the when clause of a \'taskDefinition\' contribution.")); diff --git a/vscode-paches/0047-feat-add-build-tool-to-extract-service-identifiers.patch b/vscode-paches/0047-feat-add-build-tool-to-extract-service-identifiers.patch deleted file mode 100644 index 360505df..00000000 --- a/vscode-paches/0047-feat-add-build-tool-to-extract-service-identifiers.patch +++ /dev/null @@ -1,473 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Thu, 25 Apr 2024 19:34:56 +0200 -Subject: [PATCH] feat: add build tool to extract service identifiers - ---- - build/lib/extractServices.js | 209 ++++++++++++++++++++++++++++++ - build/lib/extractServices.ts | 239 +++++++++++++++++++++++++++++++++++ - 2 files changed, 448 insertions(+) - create mode 100644 build/lib/extractServices.js - create mode 100644 build/lib/extractServices.ts - -diff --git a/build/lib/extractServices.js b/build/lib/extractServices.js -new file mode 100644 -index 00000000000..e0f9ad3724e ---- /dev/null -+++ b/build/lib/extractServices.js -@@ -0,0 +1,209 @@ -+"use strict"; -+/*--------------------------------------------------------------------------------------------- -+ * Copyright (c) Microsoft Corporation. All rights reserved. -+ * Licensed under the MIT License. See License.txt in the project root for license information. -+ *--------------------------------------------------------------------------------------------*/ -+Object.defineProperty(exports, "__esModule", { value: true }); -+/** -+ * The point of this file is to extract the service identifier to be able to import them without importing everything from the module -+ * It prevent importing useless classes when we just want to register a mocked implementation of the service -+ */ -+const ts = require("typescript"); -+const fs = require("fs"); -+const path = require("path"); -+const REPO_ROOT = path.join(__dirname, '../../'); -+const SRC_DIR = path.join(REPO_ROOT, 'src'); -+/** -+ * The language service fails to properly render imports -+ * (Either because there are namespace/interface/object using the same name -+ * or sometime an import is duplicated) -+ */ -+const ORGANIZE_IMPORTS = [ -+ 'vs/platform/log/common/log.service.ts', -+ 'vs/platform/update/common/update.service.ts', -+ 'vs/platform/markers/common/markers.service.ts', -+ 'vs/platform/userDataSync/common/userDataSync.service.ts', -+ 'vs/workbench/contrib/chat/common/chatAgents.service.ts', -+ 'vs/workbench/contrib/tasks/common/taskService.ts', -+ 'vs/workbench/workbench.web.main.ts' -+]; -+const SERVICE_REGISTRATION_FUNCTIONS_NAMES = ['createDecorator', 'refineServiceDecorator']; -+const IGNORE = [ -+ 'vs/platform/instantiation/common/instantiation', -+ // Editor services -+ 'vs/editor/', -+ 'vs/platform/actionWidget/browser/actionWidget', -+ 'vs/platform/undoRedo/common/undoRedoService', -+ 'vs/platform/instantiation/common/extensions', -+ // The extension api, not modular anyway -+ 'vs/workbench/api/' -+]; -+function findFunctionDeclarations(sourceFile, names) { -+ const declarations = []; -+ function visit(node) { -+ if (ts.isFunctionDeclaration(node) && node.name !== undefined && ts.isIdentifier(node.name) && names.includes(node.name.text)) { -+ declarations.push(node); -+ return; -+ } -+ ts.forEachChild(node, visit); -+ } -+ visit(sourceFile); -+ return declarations; -+} -+function findFirstFunctionCall(sourceFile, names) { -+ const calls = []; -+ function visit(node) { -+ if (ts.isCallExpression(node) && ts.isIdentifier(node.expression) && names.includes(node.expression.text)) { -+ calls.push(node); -+ return; -+ } -+ ts.forEachChild(node, visit); -+ } -+ visit(sourceFile); -+ return calls[0]; -+} -+function findInterface(sourceFile, name) { -+ let interfaceNode; -+ function visit(node) { -+ if (ts.isInterfaceDeclaration(node) && name === node.name.text) { -+ interfaceNode = node; -+ return; -+ } -+ ts.forEachChild(node, visit); -+ } -+ visit(sourceFile); -+ return interfaceNode; -+} -+const sourceFileVersion = new Map(); -+function incrementScriptVersion(script) { -+ const newVersion = (sourceFileVersion.get(script) ?? 1) + 1; -+ sourceFileVersion.set(script, newVersion); -+ return newVersion.toString(); -+} -+function applyEdits(edits) { -+ for (const edit of edits) { -+ const filePath = edit.fileName; -+ let fileContent = fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : ''; -+ for (const textChange of [...edit.textChanges].reverse()) { -+ const { span, newText } = textChange; -+ fileContent = fileContent.slice(0, span.start) + newText + fileContent.slice(span.start + span.length); -+ } -+ fs.writeFileSync(filePath, fileContent); -+ incrementScriptVersion(filePath); -+ } -+} -+async function run() { -+ const configPath = ts.findConfigFile(SRC_DIR, ts.sys.fileExists, 'tsconfig.json'); -+ const configFile = ts.readConfigFile(configPath, ts.sys.readFile); -+ const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, path.dirname(configPath)); -+ const servicesHost = { -+ getScriptFileNames: () => parsedConfig.fileNames.filter(f => !f.endsWith('.test.ts')), -+ getScriptVersion: fileName => sourceFileVersion.get(fileName)?.toString() ?? '1', -+ getScriptSnapshot: fileName => { -+ if (!fs.existsSync(fileName)) { -+ return undefined; -+ } -+ return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); -+ }, -+ getCurrentDirectory: () => SRC_DIR, -+ getCompilationSettings: () => ({ -+ 'paths': { -+ 'vs/*': [ -+ './vs/*' -+ ] -+ }, -+ forceConsistentCasingInFileNames: true -+ }), -+ getDefaultLibFileName: options => ts.getDefaultLibFilePath(options), -+ fileExists: ts.sys.fileExists, -+ readFile: ts.sys.readFile, -+ readDirectory: ts.sys.readDirectory, -+ directoryExists: ts.sys.directoryExists, -+ getDirectories: ts.sys.getDirectories, -+ writeFile: ts.sys.writeFile, -+ useCaseSensitiveFileNames() { -+ return true; -+ } -+ }; -+ const service = ts.createLanguageService(servicesHost, ts.createDocumentRegistry(true)); -+ const instantiationModule = service.getProgram().getSourceFile('vs/platform/instantiation/common/instantiation.ts'); -+ const serviceFiles = new Set(); -+ for (const declaration of findFunctionDeclarations(instantiationModule, SERVICE_REGISTRATION_FUNCTIONS_NAMES)) { -+ for (const ref of service.findReferences(instantiationModule.fileName, declaration.getStart())) { -+ ref.references.forEach(ref => serviceFiles.add(ref.fileName)); -+ } -+ } -+ const changedFiles = new Set(); -+ for (const fileName of serviceFiles) { -+ if (IGNORE.some(ignored => fileName.includes(ignored))) { -+ continue; -+ } -+ if (service.getProgram().getSourceFile(fileName) === undefined) { -+ throw new Error(`${fileName} not found`); -+ } -+ function moveToNewFile(range) { -+ const refactors = service.getApplicableRefactors(fileName, range, { -+ allowTextChangesInNewFiles: true, -+ allowRenameOfImportPath: true, -+ preferTypeOnlyAutoImports: true -+ }, undefined, undefined, true); -+ const moveToFileRefactor = refactors.find(r => r.name === 'Move to file'); -+ const edits = service.getEditsForRefactor(fileName, {}, range, moveToFileRefactor.name, moveToFileRefactor.actions[0].name, { -+ allowTextChangesInNewFiles: true, -+ allowRenameOfImportPath: true, -+ preferTypeOnlyAutoImports: true -+ }, { -+ targetFile: path.resolve(path.dirname(fileName), `${path.basename(fileName, '.ts')}.service.ts`) -+ }); -+ applyEdits(edits.edits); -+ edits.edits.forEach(e => changedFiles.add(e.fileName)); -+ } -+ console.log(fileName); -+ // Move service declarations to new file -+ let call; -+ const serviceNames = []; -+ while ((call = findFirstFunctionCall(service.getProgram().getSourceFile(fileName), SERVICE_REGISTRATION_FUNCTIONS_NAMES)) !== undefined) { -+ const serviceRegistrationNode = call.parent.parent.parent; -+ const serviceName = call.parent.name.text; -+ console.log('service:', serviceName); -+ serviceNames.push(serviceName); -+ const serviceInterface = findInterface(service.getProgram().getSourceFile(fileName), serviceName); -+ if (serviceInterface === undefined) { -+ throw new Error(`Service interface "${serviceInterface}" not found`); -+ } -+ const sourceFile = service.getProgram().getSourceFile(fileName); -+ const statements = [...sourceFile.getChildren()[0].getChildren().filter(ts.isStatement)]; -+ const serviceDefinitionIndex = statements.indexOf(serviceRegistrationNode); -+ const serviceInterfaceIndex = statements.indexOf(serviceInterface); -+ if (Math.abs(serviceInterfaceIndex - serviceDefinitionIndex) > 1) { -+ // Not next to each other => move the interface -+ statements.splice(serviceInterfaceIndex > serviceDefinitionIndex ? serviceDefinitionIndex + 1 : serviceDefinitionIndex, 0, ...statements.splice(serviceInterfaceIndex, 1)); -+ const newSourceFile = ts.factory.updateSourceFile(sourceFile, statements); -+ const content = ts.createPrinter().printNode(ts.EmitHint.Unspecified, newSourceFile, newSourceFile); -+ fs.writeFileSync(fileName, content); -+ incrementScriptVersion(fileName); -+ } -+ else { -+ try { -+ moveToNewFile({ -+ pos: Math.min(serviceRegistrationNode.getStart(), serviceInterface.getStart()), -+ end: Math.max(serviceRegistrationNode.getEnd(), serviceInterface.getEnd()) -+ }); -+ } -+ catch (err) { -+ console.error('Unable to extract service identifier', err); -+ break; -+ } -+ } -+ } -+ } -+ for (const changedFile of ORGANIZE_IMPORTS) { -+ console.log('Organizing imports', changedFile); -+ applyEdits(service.organizeImports({ -+ fileName: changedFile, -+ type: 'file' -+ }, {}, undefined)); -+ } -+} -+void run(); -+//# sourceMappingURL=extractServices.js.map -\ No newline at end of file -diff --git a/build/lib/extractServices.ts b/build/lib/extractServices.ts -new file mode 100644 -index 00000000000..b340f10812d ---- /dev/null -+++ b/build/lib/extractServices.ts -@@ -0,0 +1,239 @@ -+/*--------------------------------------------------------------------------------------------- -+ * Copyright (c) Microsoft Corporation. All rights reserved. -+ * Licensed under the MIT License. See License.txt in the project root for license information. -+ *--------------------------------------------------------------------------------------------*/ -+ -+/** -+ * The point of this file is to extract the service identifier to be able to import them without importing everything from the module -+ * It prevent importing useless classes when we just want to register a mocked implementation of the service -+ */ -+ -+import * as ts from 'typescript'; -+import * as fs from 'fs'; -+import * as path from 'path'; -+ -+const REPO_ROOT = path.join(__dirname, '../../'); -+const SRC_DIR = path.join(REPO_ROOT, 'src'); -+ -+/** -+ * The language service fails to properly render imports -+ * (Either because there are namespace/interface/object using the same name -+ * or sometime an import is duplicated) -+ */ -+const ORGANIZE_IMPORTS = [ -+ 'vs/platform/log/common/log.service.ts', -+ 'vs/platform/update/common/update.service.ts', -+ 'vs/platform/markers/common/markers.service.ts', -+ 'vs/platform/userDataSync/common/userDataSync.service.ts', -+ 'vs/workbench/contrib/chat/common/chatAgents.service.ts', -+ 'vs/workbench/contrib/tasks/common/taskService.ts', -+ 'vs/workbench/workbench.web.main.ts' -+]; -+ -+const SERVICE_REGISTRATION_FUNCTIONS_NAMES = ['createDecorator', 'refineServiceDecorator']; -+const IGNORE = [ -+ 'vs/platform/instantiation/common/instantiation', -+ -+ // Editor services -+ 'vs/editor/', -+ 'vs/platform/actionWidget/browser/actionWidget', -+ 'vs/platform/undoRedo/common/undoRedoService', -+ 'vs/platform/instantiation/common/extensions', -+ -+ // The extension api, not modular anyway -+ 'vs/workbench/api/' -+]; -+ -+function findFunctionDeclarations(sourceFile: ts.SourceFile, names: string[]): ts.FunctionDeclaration[] { -+ const declarations: ts.FunctionDeclaration[] = []; -+ function visit(node: ts.Node) { -+ if (ts.isFunctionDeclaration(node) && node.name !== undefined && ts.isIdentifier(node.name) && names.includes(node.name.text)) { -+ declarations.push(node); -+ return; -+ } -+ ts.forEachChild(node, visit); -+ } -+ visit(sourceFile); -+ return declarations; -+} -+ -+function findFirstFunctionCall(sourceFile: ts.SourceFile, names: string[]): ts.CallExpression | undefined { -+ const calls: ts.CallExpression[] = []; -+ function visit(node: ts.Node) { -+ if (ts.isCallExpression(node) && ts.isIdentifier(node.expression) && names.includes(node.expression.text)) { -+ calls.push(node); -+ return; -+ } -+ ts.forEachChild(node, visit); -+ } -+ visit(sourceFile); -+ return calls[0]; -+} -+ -+function findInterface(sourceFile: ts.SourceFile, name: string): ts.InterfaceDeclaration | undefined { -+ let interfaceNode: ts.InterfaceDeclaration | undefined; -+ function visit(node: ts.Node) { -+ if (ts.isInterfaceDeclaration(node) && name === node.name.text) { -+ interfaceNode = node; -+ return; -+ } -+ ts.forEachChild(node, visit); -+ } -+ visit(sourceFile); -+ return interfaceNode; -+} -+ -+const sourceFileVersion = new Map(); -+function incrementScriptVersion(script: string) { -+ const newVersion = (sourceFileVersion.get(script) ?? 1) + 1; -+ sourceFileVersion.set(script, newVersion); -+ return newVersion.toString(); -+} -+ -+function applyEdits(edits: readonly ts.FileTextChanges[]) { -+ for (const edit of edits) { -+ const filePath = edit.fileName; -+ let fileContent = fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : ''; -+ -+ for (const textChange of [...edit.textChanges].reverse()) { -+ const { span, newText } = textChange; -+ fileContent = fileContent.slice(0, span.start) + newText + fileContent.slice(span.start + span.length); -+ } -+ -+ fs.writeFileSync(filePath, fileContent); -+ incrementScriptVersion(filePath); -+ } -+} -+ -+ -+async function run() { -+ const configPath = ts.findConfigFile(SRC_DIR, ts.sys.fileExists, 'tsconfig.json')!; -+ const configFile = ts.readConfigFile(configPath, ts.sys.readFile); -+ const parsedConfig = ts.parseJsonConfigFileContent(configFile.config, ts.sys, path.dirname(configPath)); -+ -+ const servicesHost: ts.LanguageServiceHost = { -+ getScriptFileNames: () => parsedConfig.fileNames.filter(f => !f.endsWith('.test.ts')), -+ getScriptVersion: fileName => sourceFileVersion.get(fileName)?.toString() ?? '1', -+ getScriptSnapshot: fileName => { -+ if (!fs.existsSync(fileName)) { -+ return undefined; -+ } -+ -+ return ts.ScriptSnapshot.fromString(fs.readFileSync(fileName).toString()); -+ }, -+ getCurrentDirectory: () => SRC_DIR, -+ getCompilationSettings: () => ({ -+ 'paths': { -+ 'vs/*': [ -+ './vs/*' -+ ] -+ }, -+ forceConsistentCasingInFileNames: true -+ }), -+ getDefaultLibFileName: options => ts.getDefaultLibFilePath(options), -+ fileExists: ts.sys.fileExists, -+ readFile: ts.sys.readFile, -+ readDirectory: ts.sys.readDirectory, -+ directoryExists: ts.sys.directoryExists, -+ getDirectories: ts.sys.getDirectories, -+ writeFile: ts.sys.writeFile, -+ useCaseSensitiveFileNames() { -+ return true; -+ } -+ }; -+ const service = ts.createLanguageService(servicesHost, ts.createDocumentRegistry(true)); -+ -+ const instantiationModule = service.getProgram()!.getSourceFile('vs/platform/instantiation/common/instantiation.ts')!; -+ const serviceFiles = new Set(); -+ for (const declaration of findFunctionDeclarations(instantiationModule, SERVICE_REGISTRATION_FUNCTIONS_NAMES)) { -+ for (const ref of service.findReferences(instantiationModule.fileName, declaration.getStart())!) { -+ ref.references.forEach(ref => serviceFiles.add(ref.fileName)); -+ } -+ } -+ -+ const changedFiles = new Set(); -+ for (const fileName of serviceFiles) { -+ if (IGNORE.some(ignored => fileName.includes(ignored))) { -+ continue; -+ } -+ if (service.getProgram()!.getSourceFile(fileName) === undefined) { -+ throw new Error(`${fileName} not found`); -+ } -+ -+ function moveToNewFile(range: ts.TextRange) { -+ const refactors = service.getApplicableRefactors(fileName, range, { -+ allowTextChangesInNewFiles: true, -+ allowRenameOfImportPath: true, -+ preferTypeOnlyAutoImports: true -+ }, undefined, undefined, true); -+ const moveToFileRefactor = refactors.find(r => r.name === 'Move to file')!; -+ const edits = service.getEditsForRefactor(fileName, { -+ -+ }, range, moveToFileRefactor.name, moveToFileRefactor.actions[0].name, { -+ allowTextChangesInNewFiles: true, -+ allowRenameOfImportPath: true, -+ preferTypeOnlyAutoImports: true -+ }, { -+ targetFile: path.resolve(path.dirname(fileName), `${path.basename(fileName, '.ts')}.service.ts`) -+ })!; -+ -+ applyEdits(edits.edits); -+ edits.edits.forEach(e => changedFiles.add(e.fileName)); -+ } -+ -+ console.log(fileName); -+ -+ // Move service declarations to new file -+ let call: ts.CallExpression | undefined; -+ const serviceNames: string[] = []; -+ while ((call = findFirstFunctionCall(service.getProgram()!.getSourceFile(fileName)!, SERVICE_REGISTRATION_FUNCTIONS_NAMES)) !== undefined) { -+ const serviceRegistrationNode = call!.parent.parent.parent as ts.ExportDeclaration; -+ -+ const serviceName = ((call!.parent as ts.VariableDeclaration).name as ts.Identifier).text; -+ console.log('service:', serviceName); -+ serviceNames.push(serviceName); -+ -+ const serviceInterface = findInterface(service.getProgram()!.getSourceFile(fileName)!, serviceName); -+ if (serviceInterface === undefined) { -+ throw new Error(`Service interface "${serviceInterface}" not found`); -+ } -+ -+ const sourceFile = service.getProgram()!.getSourceFile(fileName)!; -+ -+ const statements = [...sourceFile.getChildren()[0].getChildren().filter(ts.isStatement)]; -+ const serviceDefinitionIndex = statements.indexOf(serviceRegistrationNode); -+ const serviceInterfaceIndex = statements.indexOf(serviceInterface); -+ -+ if (Math.abs(serviceInterfaceIndex - serviceDefinitionIndex) > 1) { -+ // Not next to each other => move the interface -+ statements.splice( -+ serviceInterfaceIndex > serviceDefinitionIndex ? serviceDefinitionIndex + 1 : serviceDefinitionIndex, 0, -+ ...statements.splice(serviceInterfaceIndex, 1) -+ ); -+ const newSourceFile = ts.factory.updateSourceFile(sourceFile, statements); -+ const content = ts.createPrinter().printNode(ts.EmitHint.Unspecified, newSourceFile, newSourceFile); -+ fs.writeFileSync(fileName, content); -+ incrementScriptVersion(fileName); -+ } else { -+ try { -+ moveToNewFile({ -+ pos: Math.min(serviceRegistrationNode.getStart(), serviceInterface!.getStart()), -+ end: Math.max(serviceRegistrationNode.getEnd(), serviceInterface!.getEnd()) -+ }); -+ } catch (err) { -+ console.error('Unable to extract service identifier', err); -+ break; -+ } -+ } -+ } -+ } -+ -+ for (const changedFile of ORGANIZE_IMPORTS) { -+ console.log('Organizing imports', changedFile); -+ applyEdits(service.organizeImports({ -+ fileName: changedFile, -+ type: 'file' -+ }, {}, undefined)); -+ } -+} -+void run(); diff --git a/vscode-paches/0048-fix-fix-editor-css.patch b/vscode-paches/0048-fix-fix-editor-css.patch deleted file mode 100644 index 445e4c72..00000000 --- a/vscode-paches/0048-fix-fix-editor-css.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 29 Apr 2024 10:37:17 +0200 -Subject: [PATCH] fix: fix editor css - -https://github.com/microsoft/monaco-editor/issues/4455 ---- - .../standalone/browser/standalone-tokens.css | 20 +++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) - -diff --git a/src/vs/editor/standalone/browser/standalone-tokens.css b/src/vs/editor/standalone/browser/standalone-tokens.css -index c74aca00541..a47a00a7aff 100644 ---- a/src/vs/editor/standalone/browser/standalone-tokens.css -+++ b/src/vs/editor/standalone/browser/standalone-tokens.css -@@ -37,16 +37,16 @@ - clip-path: inset(50%); - } - --.monaco-editor.standalone, .monaco-diff-editor.standalone .synthetic-focus, --.monaco-editor.standalone, .monaco-diff-editor.standalone [tabindex="0"]:focus, --.monaco-editor.standalone, .monaco-diff-editor.standalone [tabindex="-1"]:focus, --.monaco-editor.standalone, .monaco-diff-editor.standalone button:focus, --.monaco-editor.standalone, .monaco-diff-editor.standalone input[type=button]:focus, --.monaco-editor.standalone, .monaco-diff-editor.standalone input[type=checkbox]:focus, --.monaco-editor.standalone, .monaco-diff-editor.standalone input[type=search]:focus, --.monaco-editor.standalone, .monaco-diff-editor.standalone input[type=text]:focus, --.monaco-editor.standalone, .monaco-diff-editor.standalone select:focus, --.monaco-editor.standalone, .monaco-diff-editor.standalone textarea:focus { -+.monaco-editor.standalone .synthetic-focus, .monaco-diff-editor.standalone .synthetic-focus, -+.monaco-editor.standalone [tabindex="0"]:focus, .monaco-diff-editor.standalone [tabindex="0"]:focus, -+.monaco-editor.standalone [tabindex="-1"]:focus, .monaco-diff-editor.standalone [tabindex="-1"]:focus, -+.monaco-editor.standalone button:focus, .monaco-diff-editor.standalone button:focus, -+.monaco-editor.standalone input[type=button]:focus, .monaco-diff-editor.standalone input[type=button]:focus, -+.monaco-editor.standalone input[type=checkbox]:focus, .monaco-diff-editor.standalone input[type=checkbox]:focus, -+.monaco-editor.standalone input[type=search]:focus, .monaco-diff-editor.standalone input[type=search]:focus, -+.monaco-editor.standalone input[type=text]:focus, .monaco-diff-editor.standalone input[type=text]:focus, -+.monaco-editor.standalone select:focus, .monaco-diff-editor.standalone select:focus, -+.monaco-editor.standalone textarea:focus, .monaco-diff-editor.standalone textarea:focus { - outline-width: 1px; - outline-style: solid; - outline-offset: -1px; diff --git a/vscode-paches/0049-refactor-split-code-to-be-able-to-import-only-requir.patch b/vscode-paches/0049-refactor-split-code-to-be-able-to-import-only-requir.patch deleted file mode 100644 index 428364e7..00000000 --- a/vscode-paches/0049-refactor-split-code-to-be-able-to-import-only-requir.patch +++ /dev/null @@ -1,573 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 29 Apr 2024 17:16:21 +0200 -Subject: [PATCH] refactor: split code to be able to import only required part - ---- - .../treeSitter/treeSitterParserService.ts | 3 +- - .../common/extensionsScannerService.ts | 294 +++++++++--------- - src/vs/platform/files/common/fileService.ts | 111 ++++--- - .../localization/browser/localeService.ts | 38 ++- - 4 files changed, 237 insertions(+), 209 deletions(-) - -diff --git a/src/vs/editor/browser/services/treeSitter/treeSitterParserService.ts b/src/vs/editor/browser/services/treeSitter/treeSitterParserService.ts -index a7eed4bdd12..dcf01b1b28e 100644 ---- a/src/vs/editor/browser/services/treeSitter/treeSitterParserService.ts -+++ b/src/vs/editor/browser/services/treeSitter/treeSitterParserService.ts -@@ -15,7 +15,6 @@ import { ITelemetryService } from '../../../../platform/telemetry/common/telemet - import { ILogService } from '../../../../platform/log/common/log.js'; - import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js'; - import { setTimeout0 } from '../../../../base/common/platform.js'; --import { importAMDNodeModule } from '../../../../amdX.js'; - import { Emitter, Event } from '../../../../base/common/event.js'; - import { CancellationToken, cancelOnDispose } from '../../../../base/common/cancellation.js'; - import { IEnvironmentService } from '../../../../platform/environment/common/environment.js'; -@@ -319,7 +318,7 @@ export class TreeSitterImporter { - private _treeSitterImport: typeof import('@vscode/tree-sitter-wasm') | undefined; - private async _getTreeSitterImport() { - if (!this._treeSitterImport) { -- this._treeSitterImport = await importAMDNodeModule('@vscode/tree-sitter-wasm', 'wasm/tree-sitter.js'); -+ this._treeSitterImport = await import('@vscode/tree-sitter-wasm'); - } - return this._treeSitterImport; - } -diff --git a/src/vs/platform/extensionManagement/common/extensionsScannerService.ts b/src/vs/platform/extensionManagement/common/extensionsScannerService.ts -index 8f238a84029..4b9d098aba5 100644 ---- a/src/vs/platform/extensionManagement/common/extensionsScannerService.ts -+++ b/src/vs/platform/extensionManagement/common/extensionsScannerService.ts -@@ -545,14 +545,160 @@ export class ExtensionScannerInput { - } - } - --type NlsConfiguration = { -+export type NlsConfiguration = { - language: string | undefined; - pseudo: boolean; - devMode: boolean; - translations: Translations; - }; - --class ExtensionsScanner extends Disposable { -+export class ExtensionManifestTranslator extends Disposable { -+ constructor( -+ @IFileService protected readonly fileService: IFileService, -+ @ILogService protected readonly logService: ILogService -+ ) { -+ super(); -+ } -+ -+ private async getLocalizedMessages(extensionLocation: URI, extensionManifest: IExtensionManifest, nlsConfiguration: NlsConfiguration): Promise { -+ const defaultPackageNLS = joinPath(extensionLocation, 'package.nls.json'); -+ const reportErrors = (localized: URI | null, errors: ParseError[]): void => { -+ errors.forEach((error) => { -+ this.logService.error(this.formatMessage(extensionLocation, localize('jsonsParseReportErrors', "Failed to parse {0}: {1}.", localized?.path, getParseErrorMessage(error.error)))); -+ }); -+ }; -+ const reportInvalidFormat = (localized: URI | null): void => { -+ this.logService.error(this.formatMessage(extensionLocation, localize('jsonInvalidFormat', "Invalid format {0}: JSON object expected.", localized?.path))); -+ }; -+ -+ const translationId = `${extensionManifest.publisher}.${extensionManifest.name}`; -+ const translationPath = nlsConfiguration.translations[translationId]; -+ -+ if (translationPath) { -+ try { -+ const translationResource = URI.parse(translationPath); -+ const content = (await this.fileService.readFile(translationResource)).value.toString(); -+ const errors: ParseError[] = []; -+ const translationBundle: TranslationBundle = parse(content, errors); -+ if (errors.length > 0) { -+ reportErrors(translationResource, errors); -+ return { values: undefined, default: defaultPackageNLS }; -+ } else if (getNodeType(translationBundle) !== 'object') { -+ reportInvalidFormat(translationResource); -+ return { values: undefined, default: defaultPackageNLS }; -+ } else { -+ const values = translationBundle.contents ? translationBundle.contents.package : undefined; -+ return { values: values, default: defaultPackageNLS }; -+ } -+ } catch (error) { -+ return { values: undefined, default: defaultPackageNLS }; -+ } -+ } else { -+ const exists = await this.fileService.exists(defaultPackageNLS); -+ if (!exists) { -+ return undefined; -+ } -+ let messageBundle; -+ try { -+ messageBundle = await this.findMessageBundles(extensionLocation, nlsConfiguration); -+ } catch (error) { -+ return undefined; -+ } -+ if (!messageBundle.localized) { -+ return { values: undefined, default: messageBundle.original }; -+ } -+ try { -+ const messageBundleContent = (await this.fileService.readFile(messageBundle.localized)).value.toString(); -+ const errors: ParseError[] = []; -+ const messages: MessageBag = parse(messageBundleContent, errors); -+ if (errors.length > 0) { -+ reportErrors(messageBundle.localized, errors); -+ return { values: undefined, default: messageBundle.original }; -+ } else if (getNodeType(messages) !== 'object') { -+ reportInvalidFormat(messageBundle.localized); -+ return { values: undefined, default: messageBundle.original }; -+ } -+ return { values: messages, default: messageBundle.original }; -+ } catch (error) { -+ return { values: undefined, default: messageBundle.original }; -+ } -+ } -+ } -+ -+ public async translateManifest(extensionLocation: URI, extensionManifest: IExtensionManifest, nlsConfiguration: NlsConfiguration): Promise { -+ const localizedMessages = await this.getLocalizedMessages(extensionLocation, extensionManifest, nlsConfiguration); -+ if (localizedMessages) { -+ try { -+ const errors: ParseError[] = []; -+ // resolveOriginalMessageBundle returns null if localizedMessages.default === undefined; -+ const defaults = await this.resolveOriginalMessageBundle(localizedMessages.default, errors); -+ if (errors.length > 0) { -+ errors.forEach((error) => { -+ this.logService.error(this.formatMessage(extensionLocation, localize('jsonsParseReportErrors', "Failed to parse {0}: {1}.", localizedMessages.default?.path, getParseErrorMessage(error.error)))); -+ }); -+ return extensionManifest; -+ } else if (getNodeType(localizedMessages) !== 'object') { -+ this.logService.error(this.formatMessage(extensionLocation, localize('jsonInvalidFormat', "Invalid format {0}: JSON object expected.", localizedMessages.default?.path))); -+ return extensionManifest; -+ } -+ const localized = localizedMessages.values || Object.create(null); -+ return localizeManifest(this.logService, extensionManifest, localized, defaults); -+ } catch (error) { -+ /*Ignore Error*/ -+ } -+ } -+ return extensionManifest; -+ } -+ -+ /** -+ * Parses original message bundle, returns null if the original message bundle is null. -+ */ -+ private async resolveOriginalMessageBundle(originalMessageBundle: URI | null, errors: ParseError[]): Promise<{ [key: string]: string } | undefined> { -+ if (originalMessageBundle) { -+ try { -+ const originalBundleContent = (await this.fileService.readFile(originalMessageBundle)).value.toString(); -+ return parse(originalBundleContent, errors); -+ } catch (error) { -+ /* Ignore Error */ -+ } -+ } -+ return; -+ } -+ -+ /** -+ * Finds localized message bundle and the original (unlocalized) one. -+ * If the localized file is not present, returns null for the original and marks original as localized. -+ */ -+ private findMessageBundles(extensionLocation: URI, nlsConfiguration: NlsConfiguration): Promise<{ localized: URI; original: URI | null }> { -+ return new Promise<{ localized: URI; original: URI | null }>((c, e) => { -+ const loop = (locale: string): void => { -+ const toCheck = joinPath(extensionLocation, `package.nls.${locale}.json`); -+ this.fileService.exists(toCheck).then(exists => { -+ if (exists) { -+ c({ localized: toCheck, original: joinPath(extensionLocation, 'package.nls.json') }); -+ } -+ const index = locale.lastIndexOf('-'); -+ if (index === -1) { -+ c({ localized: joinPath(extensionLocation, 'package.nls.json'), original: null }); -+ } else { -+ locale = locale.substring(0, index); -+ loop(locale); -+ } -+ }); -+ }; -+ if (nlsConfiguration.devMode || nlsConfiguration.pseudo || !nlsConfiguration.language) { -+ return c({ localized: joinPath(extensionLocation, 'package.nls.json'), original: null }); -+ } -+ loop(nlsConfiguration.language); -+ }); -+ } -+ -+ protected formatMessage(extensionLocation: URI, message: string): string { -+ return `[${extensionLocation.path}]: ${message}`; -+ } -+} -+ -+class ExtensionsScanner extends ExtensionManifestTranslator { - - private readonly extensionsEnabledWithApiProposalVersion: string[]; - -@@ -560,12 +706,12 @@ class ExtensionsScanner extends Disposable { - private readonly obsoleteFile: URI, - @IExtensionsProfileScannerService protected readonly extensionsProfileScannerService: IExtensionsProfileScannerService, - @IUriIdentityService protected readonly uriIdentityService: IUriIdentityService, -- @IFileService protected readonly fileService: IFileService, -+ @IFileService fileService: IFileService, - @IProductService productService: IProductService, - @IEnvironmentService private readonly environmentService: IEnvironmentService, -- @ILogService protected readonly logService: ILogService -+ @ILogService logService: ILogService - ) { -- super(); -+ super(fileService, logService); - this.extensionsEnabledWithApiProposalVersion = productService.extensionsEnabledWithApiProposalVersion?.map(id => id.toLowerCase()) ?? []; - } - -@@ -731,144 +877,6 @@ class ExtensionsScanner extends Disposable { - } - return manifest; - } -- -- private async translateManifest(extensionLocation: URI, extensionManifest: IExtensionManifest, nlsConfiguration: NlsConfiguration): Promise { -- const localizedMessages = await this.getLocalizedMessages(extensionLocation, extensionManifest, nlsConfiguration); -- if (localizedMessages) { -- try { -- const errors: ParseError[] = []; -- // resolveOriginalMessageBundle returns null if localizedMessages.default === undefined; -- const defaults = await this.resolveOriginalMessageBundle(localizedMessages.default, errors); -- if (errors.length > 0) { -- errors.forEach((error) => { -- this.logService.error(this.formatMessage(extensionLocation, localize('jsonsParseReportErrors', "Failed to parse {0}: {1}.", localizedMessages.default?.path, getParseErrorMessage(error.error)))); -- }); -- return extensionManifest; -- } else if (getNodeType(localizedMessages) !== 'object') { -- this.logService.error(this.formatMessage(extensionLocation, localize('jsonInvalidFormat', "Invalid format {0}: JSON object expected.", localizedMessages.default?.path))); -- return extensionManifest; -- } -- const localized = localizedMessages.values || Object.create(null); -- return localizeManifest(this.logService, extensionManifest, localized, defaults); -- } catch (error) { -- /*Ignore Error*/ -- } -- } -- return extensionManifest; -- } -- -- private async getLocalizedMessages(extensionLocation: URI, extensionManifest: IExtensionManifest, nlsConfiguration: NlsConfiguration): Promise { -- const defaultPackageNLS = joinPath(extensionLocation, 'package.nls.json'); -- const reportErrors = (localized: URI | null, errors: ParseError[]): void => { -- errors.forEach((error) => { -- this.logService.error(this.formatMessage(extensionLocation, localize('jsonsParseReportErrors', "Failed to parse {0}: {1}.", localized?.path, getParseErrorMessage(error.error)))); -- }); -- }; -- const reportInvalidFormat = (localized: URI | null): void => { -- this.logService.error(this.formatMessage(extensionLocation, localize('jsonInvalidFormat', "Invalid format {0}: JSON object expected.", localized?.path))); -- }; -- -- const translationId = `${extensionManifest.publisher}.${extensionManifest.name}`; -- const translationPath = nlsConfiguration.translations[translationId]; -- -- if (translationPath) { -- try { -- const translationResource = URI.file(translationPath); -- const content = (await this.fileService.readFile(translationResource)).value.toString(); -- const errors: ParseError[] = []; -- const translationBundle: TranslationBundle = parse(content, errors); -- if (errors.length > 0) { -- reportErrors(translationResource, errors); -- return { values: undefined, default: defaultPackageNLS }; -- } else if (getNodeType(translationBundle) !== 'object') { -- reportInvalidFormat(translationResource); -- return { values: undefined, default: defaultPackageNLS }; -- } else { -- const values = translationBundle.contents ? translationBundle.contents.package : undefined; -- return { values: values, default: defaultPackageNLS }; -- } -- } catch (error) { -- return { values: undefined, default: defaultPackageNLS }; -- } -- } else { -- const exists = await this.fileService.exists(defaultPackageNLS); -- if (!exists) { -- return undefined; -- } -- let messageBundle; -- try { -- messageBundle = await this.findMessageBundles(extensionLocation, nlsConfiguration); -- } catch (error) { -- return undefined; -- } -- if (!messageBundle.localized) { -- return { values: undefined, default: messageBundle.original }; -- } -- try { -- const messageBundleContent = (await this.fileService.readFile(messageBundle.localized)).value.toString(); -- const errors: ParseError[] = []; -- const messages: MessageBag = parse(messageBundleContent, errors); -- if (errors.length > 0) { -- reportErrors(messageBundle.localized, errors); -- return { values: undefined, default: messageBundle.original }; -- } else if (getNodeType(messages) !== 'object') { -- reportInvalidFormat(messageBundle.localized); -- return { values: undefined, default: messageBundle.original }; -- } -- return { values: messages, default: messageBundle.original }; -- } catch (error) { -- return { values: undefined, default: messageBundle.original }; -- } -- } -- } -- -- /** -- * Parses original message bundle, returns null if the original message bundle is null. -- */ -- private async resolveOriginalMessageBundle(originalMessageBundle: URI | null, errors: ParseError[]): Promise<{ [key: string]: string } | undefined> { -- if (originalMessageBundle) { -- try { -- const originalBundleContent = (await this.fileService.readFile(originalMessageBundle)).value.toString(); -- return parse(originalBundleContent, errors); -- } catch (error) { -- /* Ignore Error */ -- } -- } -- return; -- } -- -- /** -- * Finds localized message bundle and the original (unlocalized) one. -- * If the localized file is not present, returns null for the original and marks original as localized. -- */ -- private findMessageBundles(extensionLocation: URI, nlsConfiguration: NlsConfiguration): Promise<{ localized: URI; original: URI | null }> { -- return new Promise<{ localized: URI; original: URI | null }>((c, e) => { -- const loop = (locale: string): void => { -- const toCheck = joinPath(extensionLocation, `package.nls.${locale}.json`); -- this.fileService.exists(toCheck).then(exists => { -- if (exists) { -- c({ localized: toCheck, original: joinPath(extensionLocation, 'package.nls.json') }); -- } -- const index = locale.lastIndexOf('-'); -- if (index === -1) { -- c({ localized: joinPath(extensionLocation, 'package.nls.json'), original: null }); -- } else { -- locale = locale.substring(0, index); -- loop(locale); -- } -- }); -- }; -- if (nlsConfiguration.devMode || nlsConfiguration.pseudo || !nlsConfiguration.language) { -- return c({ localized: joinPath(extensionLocation, 'package.nls.json'), original: null }); -- } -- loop(nlsConfiguration.language); -- }); -- } -- -- private formatMessage(extensionLocation: URI, message: string): string { -- return `[${extensionLocation.path}]: ${message}`; -- } -- - } - - interface IExtensionCacheData { -diff --git a/src/vs/platform/files/common/fileService.ts b/src/vs/platform/files/common/fileService.ts -index 2c0bfe1369c..e40cc7c20b0 100644 ---- a/src/vs/platform/files/common/fileService.ts -+++ b/src/vs/platform/files/common/fileService.ts -@@ -23,6 +23,64 @@ import { readFileIntoStream } from './io.js'; - import { ILogService } from '../../log/common/log.js'; - import { ErrorNoTelemetry } from '../../../base/common/errors.js'; - -+ -+function resourceForError(resource: URI): string { -+ if (resource.scheme === Schemas.file) { -+ return resource.fsPath; -+ } -+ -+ return resource.toString(true); -+} -+ -+export async function mkdirp(providerExtUri: IExtUri, provider: IFileSystemProvider, directory: URI): Promise { -+ const directoriesToCreate: string[] = []; -+ -+ // mkdir until we reach root -+ while (!providerExtUri.isEqual(directory, providerExtUri.dirname(directory))) { -+ try { -+ const stat = await provider.stat(directory); -+ if ((stat.type & FileType.Directory) === 0) { -+ throw new Error(localize('mkdirExistsError', "Unable to create folder '{0}' that already exists but is not a directory", resourceForError(directory))); -+ } -+ -+ break; // we have hit a directory that exists -> good -+ } catch (error) { -+ -+ // Bubble up any other error that is not file not found -+ if (toFileSystemProviderErrorCode(error) !== FileSystemProviderErrorCode.FileNotFound) { -+ throw error; -+ } -+ -+ // Upon error, remember directories that need to be created -+ directoriesToCreate.push(providerExtUri.basename(directory)); -+ -+ // Continue up -+ directory = providerExtUri.dirname(directory); -+ } -+ } -+ -+ // Create directories as needed -+ for (let i = directoriesToCreate.length - 1; i >= 0; i--) { -+ directory = providerExtUri.joinPath(directory, directoriesToCreate[i]); -+ -+ try { -+ await provider.mkdir(directory); -+ } catch (error) { -+ if (toFileSystemProviderErrorCode(error) !== FileSystemProviderErrorCode.FileExists) { -+ // For mkdirp() we tolerate that the mkdir() call fails -+ // in case the folder already exists. This follows node.js -+ // own implementation of fs.mkdir({ recursive: true }) and -+ // reduces the chances of race conditions leading to errors -+ // if multiple calls try to create the same folders -+ // As such, we only throw an error here if it is other than -+ // the fact that the file already exists. -+ // (see also https://github.com/microsoft/vscode/issues/89834) -+ throw error; -+ } -+ } -+ } -+} -+ - export class FileService extends Disposable implements IFileService { - - declare readonly _serviceBrand: undefined; -@@ -937,53 +995,8 @@ export class FileService extends Disposable implements IFileService { - } - - private async mkdirp(provider: IFileSystemProvider, directory: URI): Promise { -- const directoriesToCreate: string[] = []; -- -- // mkdir until we reach root - const { providerExtUri } = this.getExtUri(provider); -- while (!providerExtUri.isEqual(directory, providerExtUri.dirname(directory))) { -- try { -- const stat = await provider.stat(directory); -- if ((stat.type & FileType.Directory) === 0) { -- throw new Error(localize('mkdirExistsError', "Unable to create folder '{0}' that already exists but is not a directory", this.resourceForError(directory))); -- } -- -- break; // we have hit a directory that exists -> good -- } catch (error) { -- -- // Bubble up any other error that is not file not found -- if (toFileSystemProviderErrorCode(error) !== FileSystemProviderErrorCode.FileNotFound) { -- throw error; -- } -- -- // Upon error, remember directories that need to be created -- directoriesToCreate.push(providerExtUri.basename(directory)); -- -- // Continue up -- directory = providerExtUri.dirname(directory); -- } -- } -- -- // Create directories as needed -- for (let i = directoriesToCreate.length - 1; i >= 0; i--) { -- directory = providerExtUri.joinPath(directory, directoriesToCreate[i]); -- -- try { -- await provider.mkdir(directory); -- } catch (error) { -- if (toFileSystemProviderErrorCode(error) !== FileSystemProviderErrorCode.FileExists) { -- // For mkdirp() we tolerate that the mkdir() call fails -- // in case the folder already exists. This follows node.js -- // own implementation of fs.mkdir({ recursive: true }) and -- // reduces the chances of race conditions leading to errors -- // if multiple calls try to create the same folders -- // As such, we only throw an error here if it is other than -- // the fact that the file already exists. -- // (see also https://github.com/microsoft/vscode/issues/89834) -- throw error; -- } -- } -- } -+ return mkdirp(providerExtUri, provider, directory); - } - - async canDelete(resource: URI, options?: Partial): Promise { -@@ -1436,11 +1449,7 @@ export class FileService extends Disposable implements IFileService { - } - - private resourceForError(resource: URI): string { -- if (resource.scheme === Schemas.file) { -- return resource.fsPath; -- } -- -- return resource.toString(true); -+ return resourceForError(resource); - } - - //#endregion -diff --git a/src/vs/workbench/services/localization/browser/localeService.ts b/src/vs/workbench/services/localization/browser/localeService.ts -index 63082ed6952..a107a2f8695 100644 ---- a/src/vs/workbench/services/localization/browser/localeService.ts -+++ b/src/vs/workbench/services/localization/browser/localeService.ts -@@ -51,8 +51,7 @@ const localeStorage = new class LocaleStorage { - } - }; - --export class WebLocaleService implements ILocaleService { -- -+export abstract class AbstractLocaleService implements ILocaleService { - declare readonly _serviceBrand: undefined; - - constructor( -@@ -61,20 +60,15 @@ export class WebLocaleService implements ILocaleService { - @IProductService private readonly productService: IProductService - ) { } - -+ abstract storeLocale(locale: string | undefined, extensionId: string | undefined): Promise; -+ abstract clearLocale(): Promise; -+ - async setLocale(languagePackItem: ILanguagePackItem, _skipDialog = false): Promise { - const locale = languagePackItem.id; - if (locale === Language.value() || (!locale && Language.value() === navigator.language.toLowerCase())) { - return; - } -- if (locale) { -- localeStorage.setLocale(locale); -- if (languagePackItem.extensionId) { -- localeStorage.setExtensionId(languagePackItem.extensionId); -- } -- } else { -- localeStorage.clearLocale(); -- localeStorage.clearExtensionId(); -- } -+ this.storeLocale(locale, languagePackItem.extensionId); - - const restartDialog = await this.dialogService.confirm({ - type: 'info', -@@ -89,8 +83,7 @@ export class WebLocaleService implements ILocaleService { - } - - async clearLocalePreference(): Promise { -- localeStorage.clearLocale(); -- localeStorage.clearExtensionId(); -+ this.clearLocale(); - - if (Language.value() === navigator.language.toLowerCase()) { - return; -@@ -109,6 +102,25 @@ export class WebLocaleService implements ILocaleService { - } - } - -+export class WebLocaleService extends AbstractLocaleService { -+ override async storeLocale(locale: string | undefined, extensionId: string | undefined): Promise { -+ if (locale) { -+ localeStorage.setLocale(locale); -+ if (extensionId) { -+ localeStorage.setExtensionId(extensionId); -+ } -+ } else { -+ localeStorage.clearLocale(); -+ localeStorage.clearExtensionId(); -+ } -+ } -+ -+ override async clearLocale(): Promise { -+ localeStorage.clearLocale(); -+ localeStorage.clearExtensionId(); -+ } -+} -+ - export class WebActiveLanguagePackService implements IActiveLanguagePackService { - _serviceBrand: undefined; - diff --git a/vscode-paches/0050-fix-rollback-typescript-as-the-last-version-breaks-t.patch b/vscode-paches/0050-fix-rollback-typescript-as-the-last-version-breaks-t.patch deleted file mode 100644 index 6d7b9c28..00000000 --- a/vscode-paches/0050-fix-rollback-typescript-as-the-last-version-breaks-t.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Fri, 2 Aug 2024 14:20:58 +0200 -Subject: [PATCH] fix: rollback typescript as the last version breaks the - extractServices script - ---- - package-lock.json | 8 ++++---- - package.json | 2 +- - src/vs/base/parts/request/browser/request.ts | 1 + - 3 files changed, 6 insertions(+), 5 deletions(-) - -diff --git a/package-lock.json b/package-lock.json -index 7b029961668..b0904ba0f51 100644 ---- a/package-lock.json -+++ b/package-lock.json -@@ -154,7 +154,7 @@ - "ts-node": "^10.9.1", - "tsec": "0.2.7", - "tslib": "^2.6.3", -- "typescript": "^5.7.0-dev.20240903", -+ "typescript": "5.5.0-dev.20240408", - "util": "^0.12.4", - "webpack": "^5.94.0", - "webpack-cli": "^5.1.4", -@@ -18579,9 +18579,9 @@ - "dev": true - }, - "node_modules/typescript": { -- "version": "5.7.0-dev.20240903", -- "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.0-dev.20240903.tgz", -- "integrity": "sha512-XTUc5uVwBbLlT0v3FqTx9sDN1MLQnT5mwSC3JefCrcKT6Zv+rPcQE7HLKM9IsrNiM1tiaQvamJTgVH0S+UMH2A==", -+ "version": "5.5.0-dev.20240408", -+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.0-dev.20240408.tgz", -+ "integrity": "sha512-WCqFA68PbE0+khOu6x2LPxePy0tKdWuNO2m2K4A/L+OPqua1Qmck9OXUQ/5nUd4B/8UlBuhkhuulQbr2LHO9vA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", -diff --git a/package.json b/package.json -index 7e0de1810c6..ff1e24a30ba 100644 ---- a/package.json -+++ b/package.json -@@ -216,7 +216,7 @@ - "ts-node": "^10.9.1", - "tsec": "0.2.7", - "tslib": "^2.6.3", -- "typescript": "^5.7.0-dev.20240903", -+ "typescript": "5.5.0-dev.20240408", - "util": "^0.12.4", - "webpack": "^5.94.0", - "webpack-cli": "^5.1.4", -diff --git a/src/vs/base/parts/request/browser/request.ts b/src/vs/base/parts/request/browser/request.ts -index fe0fa0e7838..2c46daa9b6d 100644 ---- a/src/vs/base/parts/request/browser/request.ts -+++ b/src/vs/base/parts/request/browser/request.ts -@@ -15,6 +15,7 @@ export async function request(options: IRequestOptions, token: CancellationToken - - const cancellation = new AbortController(); - const disposable = token.onCancellationRequested(() => cancellation.abort()); -+ // @ts-ignore AbortSignal exists in more recent versions of typescript - const signal = options.timeout ? AbortSignal.any([ - cancellation.signal, - AbortSignal.timeout(options.timeout), diff --git a/vscode-paches/0051-fix-just-use-regular-dynamic-import.patch b/vscode-paches/0051-fix-just-use-regular-dynamic-import.patch deleted file mode 100644 index 2cae0ff0..00000000 --- a/vscode-paches/0051-fix-just-use-regular-dynamic-import.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Thu, 12 Sep 2024 19:19:39 +0200 -Subject: [PATCH] fix: just use regular dynamic import - ---- - .../services/keybinding/browser/keyboardLayoutService.ts | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - -diff --git a/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts b/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts -index 28f6ea57c03..0ab2ac0cdc0 100644 ---- a/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts -+++ b/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts -@@ -5,8 +5,6 @@ - - import * as nls from '../../../../nls.js'; - import { Emitter, Event } from '../../../../base/common/event.js'; --import { isESM } from '../../../../base/common/amd.js'; --import { AppResourcePath, FileAccess } from '../../../../base/common/network.js'; - import { Disposable } from '../../../../base/common/lifecycle.js'; - import { KeymapInfo, IRawMixedKeyboardMapping, IKeymapInfo } from '../common/keymapInfo.js'; - import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; -@@ -457,10 +455,7 @@ export class BrowserKeyboardMapperFactory extends BrowserKeyboardMapperFactoryBa - - const platform = isWindows ? 'win' : isMacintosh ? 'darwin' : 'linux'; - -- import(isESM ? -- FileAccess.asBrowserUri(`vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.${platform}.js` satisfies AppResourcePath).path : -- `vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.${platform}` -- ).then((m) => { -+ import(`./keyboardLayouts/layout.contribution.${platform}.js`).then((m) => { - const keymapInfos: IKeymapInfo[] = m.KeyboardLayoutContribution.INSTANCE.layoutInfos; - this._keymapInfos.push(...keymapInfos.map(info => (new KeymapInfo(info.layout, info.secondaryLayouts, info.mapping, info.isUserKeyboardLayout)))); - this._mru = this._keymapInfos; diff --git a/vscode-paches/0052-fix-fix-treeshaking-script.patch b/vscode-paches/0052-fix-fix-treeshaking-script.patch deleted file mode 100644 index c0da3f63..00000000 --- a/vscode-paches/0052-fix-fix-treeshaking-script.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Sun, 6 Oct 2024 16:29:10 +0200 -Subject: [PATCH] fix: fix treeshaking script - ---- - build/lib/treeshaking.js | 1 + - build/lib/treeshaking.ts | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/build/lib/treeshaking.js b/build/lib/treeshaking.js -index af06f4e3ec5..323603d8bfa 100644 ---- a/build/lib/treeshaking.js -+++ b/build/lib/treeshaking.js -@@ -104,6 +104,7 @@ function discoverAndReadFiles(ts, options) { - if (options.redirects[moduleId]) { - redirectedModuleId = options.redirects[moduleId]; - } -+ redirectedModuleId = moduleId.replace(/.js$/, ''); - const dts_filename = path.join(options.sourcesRoot, redirectedModuleId + '.d.ts'); - if (fs.existsSync(dts_filename)) { - const dts_filecontents = fs.readFileSync(dts_filename).toString(); -diff --git a/build/lib/treeshaking.ts b/build/lib/treeshaking.ts -index cd17c5f0278..bbb9abf8169 100644 ---- a/build/lib/treeshaking.ts -+++ b/build/lib/treeshaking.ts -@@ -159,6 +159,7 @@ function discoverAndReadFiles(ts: typeof import('typescript'), options: ITreeSha - if (options.redirects[moduleId]) { - redirectedModuleId = options.redirects[moduleId]; - } -+ redirectedModuleId = moduleId.replace(/.js$/, ''); - - const dts_filename = path.join(options.sourcesRoot, redirectedModuleId + '.d.ts'); - if (fs.existsSync(dts_filename)) { diff --git a/vscode-paches/0054-fix-make-editor-types-build-until-it-s-fixed-by-MS.patch b/vscode-paches/0054-fix-make-editor-types-build-until-it-s-fixed-by-MS.patch deleted file mode 100644 index 50f11fcc..00000000 --- a/vscode-paches/0054-fix-make-editor-types-build-until-it-s-fixed-by-MS.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Sun, 6 Oct 2024 18:36:08 +0200 -Subject: [PATCH] fix: make editor types build until it's fixed by MS - ---- - build/gulpfile.editor.js | 28 ++++++++++++++-------------- - 1 file changed, 14 insertions(+), 14 deletions(-) - -diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js -index a5951d21d34..44c61cb0dfd 100644 ---- a/build/gulpfile.editor.js -+++ b/build/gulpfile.editor.js -@@ -77,7 +77,7 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => { - extrausages - ], - shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers -- importIgnorePattern: /\.css$/, -+ importIgnorePattern: /\.css$|^@vscode\//, - destRoot: path.join(root, 'out-editor-src'), - redirects: { - '@vscode/tree-sitter-wasm': '../node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-web', -@@ -366,19 +366,19 @@ gulp.task('extract-editor-src', - - gulp.task('editor-distro', - task.series( -- task.parallel( -- util.rimraf('out-editor-src'), -- util.rimraf('out-editor-build'), -- util.rimraf('out-editor-esm'), -- util.rimraf('out-monaco-editor-core'), -- util.rimraf('out-editor'), -- util.rimraf('out-editor-min') -- ), -- extractEditorSrcTask, -- task.series( -- createESMSourcesAndResourcesTask, -- compileEditorESMTask, -- ), -+ // task.parallel( -+ // util.rimraf('out-editor-src'), -+ // util.rimraf('out-editor-build'), -+ // util.rimraf('out-editor-esm'), -+ // util.rimraf('out-monaco-editor-core'), -+ // util.rimraf('out-editor'), -+ // util.rimraf('out-editor-min') -+ // ), -+ // extractEditorSrcTask, -+ // task.series( -+ // createESMSourcesAndResourcesTask, -+ // compileEditorESMTask, -+ // ), - finalEditorResourcesTask - ) - ); diff --git a/vscode-paches/0055-fix-allow-data-urls-in-extension-host-worker.patch b/vscode-paches/0055-fix-allow-data-urls-in-extension-host-worker.patch deleted file mode 100644 index 7f270d7e..00000000 --- a/vscode-paches/0055-fix-allow-data-urls-in-extension-host-worker.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Thu, 17 Oct 2024 16:24:45 +0200 -Subject: [PATCH] fix: allow data urls in extension host worker - ---- - .../extensions/worker/webWorkerExtensionHostIframe.esm.html | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html b/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html -index 9a3c7cec21d..85505f08114 100644 ---- a/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html -+++ b/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html -@@ -5,7 +5,7 @@ - default-src 'none'; - child-src 'self' data: blob:; - script-src 'self' 'unsafe-eval' 'sha256-fCnZ3iXydTZHO961jO3ioYDdWSfm8PZg/rI6zFX/SE0=' https: http://localhost:* blob:; -- connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/> -+ connect-src 'self' data: https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/> - - -