From 0751bc975ad16f0b91ce605ba1b0d982d6584e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 7 Oct 2024 15:25:52 +0200 Subject: [PATCH 1/7] lib: update VSCode to 1.94 --- package-lock.json | 1868 +++++++---------- package.json | 53 +- rollup/rollup.config.ts | 3 + src/extension.api.ts | 3 +- src/missing-services.ts | 55 +- src/service-override/chat.ts | 9 +- src/service-override/viewCommon.ts | 5 +- ...fix-allow-importing-vscode-oniguruma.patch | 4 +- .../0002-fix-fix-editor-api-types.patch | 4 +- ...-amd-build-to-speed-up-editor-build.patch} | 10 +- ...ix-fix-some-build-process-edge-cases.patch | 60 - ...22.patch => 0004-feat-output-es2022.patch} | 26 +- ...arkdown-do-not-encode-i10l-location.patch} | 0 ...ix-typescript-handle-trailing-slash.patch} | 0 ...ix-typescript-missing-default-value.patch} | 0 ...-fix-typescript-handle-missing-case.patch} | 0 ...feat-add-static-asset-url-mechanism.patch} | 46 +- ...rl-search-parameter-breaking-import.patch} | 0 ...ly-style-only-on-standalone-editors.patch} | 28 +- ...tch => 0012-fix-use-existing-method.patch} | 2 +- ...e.patch => 0013-refactor-split-code.patch} | 4 +- ...de-already-done-in-EditorFeaturesIn.patch} | 18 +- ...mports-by-regular-esm-dynamic-impor.patch} | 271 +-- ...classes-and-make-some-methods-acces.patch} | 114 +- ...mprove-extension-contribution-types.patch} | 18 +- ...> 0018-fix-fix-dependency-injection.patch} | 2 +- ...-run-some-code-if-inside-the-worker.patch} | 42 +- ...de-log-services-even-in-main-thread.patch} | 47 +- ...feat-expose-extHostExtensionService.patch} | 15 +- ...anup-remove-non-ESM-compatible-code.patch} | 77 +- ...tch => 0023-feat-expose-api-factory.patch} | 12 +- ...me-modules-to-be-able-to-import-the.patch} | 233 +- ... => 0025-fix-replace-map-by-forEach.patch} | 6 +- ...-only-apply-style-on-specific-class.patch} | 2 +- ...ileAccess.asBrowserUri-at-the-root-.patch} | 56 +- ...nup-remove-some-checks-and-warnings.patch} | 14 +- ...h => 0029-refactor-split-class-in-2.patch} | 6 +- ...supported-as-soon-as-there-is-a-reg.patch} | 48 +- ...-use-asBrowserUri-to-get-iframe-src.patch} | 2 +- ...d-some-parameter-to-webview-iframes.patch} | 20 +- ...tect-fullscreen-if-it-s-not-a-guess.patch} | 4 +- ...tch => 0034-fix-only-use-open-model.patch} | 12 +- ...equire-by-FileAccess.toModuleConten.patch} | 12 +- ...a-local-folder-even-when-there-is-a.patch} | 18 +- ...to-switch-storage-service-workspace.patch} | 2 +- ...move-code-that-we-will-run-ourselves.patch | 68 + ...move-code-that-we-will-run-ourselves.patch | 68 - ...e-import-function-able-to-replace-i.patch} | 0 ...-detect-if-localization-were-alread.patch} | 2 +- ...n-from-service-file-to-contribution.patch} | 52 +- ...factor-split-workbench-contribution.patch} | 156 +- ...r-split-service-and-extension-point.patch} | 114 +- ...ntax.patch => 0044-fix-weird-syntax.patch} | 14 +- ...t-stuff-from-web-workbench-or-the-ty.patch | 104 + ...-that-language-service-refactor-doe.patch} | 8 +- ...t-stuff-from-web-workbench-or-the-ty.patch | 54 - ...tool-to-extract-service-identifiers.patch} | 0 ...ss.patch => 0048-fix-fix-editor-css.patch} | 0 ...de-to-be-able-to-import-only-requir.patch} | 44 +- ...escript-as-the-last-version-breaks-t.patch | 63 + ...fix-just-use-regular-dynamic-import.patch} | 16 +- ...escript-as-the-last-version-breaks-t.patch | 36 - .../0052-fix-fix-treeshaking-script.patch | 34 + vscode-paches/0053-fix-fix-build.patch | 29 + ...r-types-build-until-it-s-fixed-by-MS.patch | 55 + 65 files changed, 1985 insertions(+), 2163 deletions(-) rename vscode-paches/{0004-cleanup-remove-amd-build-to-speed-up-editor-build.patch => 0003-cleanup-remove-amd-build-to-speed-up-editor-build.patch} (75%) delete mode 100644 vscode-paches/0003-fix-fix-some-build-process-edge-cases.patch rename vscode-paches/{0005-feat-output-es2022.patch => 0004-feat-output-es2022.patch} (65%) rename vscode-paches/{0006-fix-markdown-do-not-encode-i10l-location.patch => 0005-fix-markdown-do-not-encode-i10l-location.patch} (100%) rename vscode-paches/{0007-fix-typescript-handle-trailing-slash.patch => 0006-fix-typescript-handle-trailing-slash.patch} (100%) rename vscode-paches/{0008-fix-typescript-missing-default-value.patch => 0007-fix-typescript-missing-default-value.patch} (100%) rename vscode-paches/{0009-fix-typescript-handle-missing-case.patch => 0008-fix-typescript-handle-missing-case.patch} (100%) rename vscode-paches/{0010-feat-add-static-asset-url-mechanism.patch => 0009-feat-add-static-asset-url-mechanism.patch} (92%) rename vscode-paches/{0011-fix-remove-ttf-url-search-parameter-breaking-import.patch => 0010-fix-remove-ttf-url-search-parameter-breaking-import.patch} (100%) rename vscode-paches/{0012-fix-apply-style-only-on-standalone-editors.patch => 0011-fix-apply-style-only-on-standalone-editors.patch} (94%) rename vscode-paches/{0013-fix-use-existing-method.patch => 0012-fix-use-existing-method.patch} (97%) rename vscode-paches/{0014-refactor-split-code.patch => 0013-refactor-split-code.patch} (97%) rename vscode-paches/{0015-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch => 0014-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch} (64%) rename vscode-paches/{0016-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch => 0015-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch} (59%) rename vscode-paches/{0017-feat-export-some-classes-and-make-some-methods-acces.patch => 0016-feat-export-some-classes-and-make-some-methods-acces.patch} (87%) rename vscode-paches/{0018-fix-improve-extension-contribution-types.patch => 0017-fix-improve-extension-contribution-types.patch} (99%) rename vscode-paches/{0019-fix-fix-dependency-injection.patch => 0018-fix-fix-dependency-injection.patch} (96%) rename vscode-paches/{0020-fix-only-run-some-code-if-inside-the-worker.patch => 0019-fix-only-run-some-code-if-inside-the-worker.patch} (70%) rename vscode-paches/{0021-fix-override-log-services-even-in-main-thread.patch => 0020-fix-override-log-services-even-in-main-thread.patch} (50%) rename vscode-paches/{0022-feat-expose-extHostExtensionService.patch => 0021-feat-expose-extHostExtensionService.patch} (50%) rename vscode-paches/{0023-cleanup-remove-non-ESM-compatible-code.patch => 0022-cleanup-remove-non-ESM-compatible-code.patch} (70%) rename vscode-paches/{0024-feat-expose-api-factory.patch => 0023-feat-expose-api-factory.patch} (79%) rename vscode-paches/{0025-refactor-split-some-modules-to-be-able-to-import-the.patch => 0024-refactor-split-some-modules-to-be-able-to-import-the.patch} (92%) rename vscode-paches/{0026-fix-replace-map-by-forEach.patch => 0025-fix-replace-map-by-forEach.patch} (93%) rename vscode-paches/{0027-feat-only-apply-style-on-specific-class.patch => 0026-feat-only-apply-style-on-specific-class.patch} (99%) rename vscode-paches/{0028-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch => 0027-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch} (64%) rename vscode-paches/{0029-cleanup-remove-some-checks-and-warnings.patch => 0028-cleanup-remove-some-checks-and-warnings.patch} (93%) rename vscode-paches/{0030-refactor-split-class-in-2.patch => 0029-refactor-split-class-in-2.patch} (97%) rename vscode-paches/{0031-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch => 0030-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch} (76%) rename vscode-paches/{0032-fix-use-asBrowserUri-to-get-iframe-src.patch => 0031-fix-use-asBrowserUri-to-get-iframe-src.patch} (97%) rename vscode-paches/{0033-feat-add-some-parameter-to-webview-iframes.patch => 0032-feat-add-some-parameter-to-webview-iframes.patch} (65%) rename vscode-paches/{0034-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch => 0033-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch} (95%) rename vscode-paches/{0035-fix-only-use-open-model.patch => 0034-fix-only-use-open-model.patch} (90%) rename vscode-paches/{0036-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch => 0035-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch} (69%) rename vscode-paches/{0037-fix-allow-adding-a-local-folder-even-when-there-is-a.patch => 0036-fix-allow-adding-a-local-folder-even-when-there-is-a.patch} (72%) rename vscode-paches/{0038-feat-allow-to-switch-storage-service-workspace.patch => 0037-feat-allow-to-switch-storage-service-workspace.patch} (98%) create mode 100644 vscode-paches/0038-cleanup-remove-code-that-we-will-run-ourselves.patch delete mode 100644 vscode-paches/0039-cleanup-remove-code-that-we-will-run-ourselves.patch rename vscode-paches/{0040-fix-typescript-use-import-function-able-to-replace-i.patch => 0039-fix-typescript-use-import-function-able-to-replace-i.patch} (100%) rename vscode-paches/{0041-feat-add-a-way-to-detect-if-localization-were-alread.patch => 0040-feat-add-a-way-to-detect-if-localization-were-alread.patch} (96%) rename vscode-paches/{0042-fix-move-action-from-service-file-to-contribution.patch => 0041-fix-move-action-from-service-file-to-contribution.patch} (76%) rename vscode-paches/{0043-refactor-split-workbench-contribution.patch => 0042-refactor-split-workbench-contribution.patch} (61%) rename vscode-paches/{0044-refactor-split-service-and-extension-point.patch => 0043-refactor-split-service-and-extension-point.patch} (77%) rename vscode-paches/{0045-fix-weird-syntax.patch => 0044-fix-weird-syntax.patch} (64%) create mode 100644 vscode-paches/0045-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch rename vscode-paches/{0047-fix-change-syntax-that-language-service-refactor-doe.patch => 0046-fix-change-syntax-that-language-service-refactor-doe.patch} (86%) delete mode 100644 vscode-paches/0046-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch rename vscode-paches/{0048-feat-add-build-tool-to-extract-service-identifiers.patch => 0047-feat-add-build-tool-to-extract-service-identifiers.patch} (100%) rename vscode-paches/{0049-fix-fix-editor-css.patch => 0048-fix-fix-editor-css.patch} (100%) rename vscode-paches/{0050-refactor-split-code-to-be-able-to-import-only-requir.patch => 0049-refactor-split-code-to-be-able-to-import-only-requir.patch} (91%) create mode 100644 vscode-paches/0050-fix-rollback-typescript-as-the-last-version-breaks-t.patch rename vscode-paches/{0052-fix-just-use-regular-dynamic-import.patch => 0051-fix-just-use-regular-dynamic-import.patch} (75%) delete mode 100644 vscode-paches/0051-fix-rollback-typescript-as-the-last-version-breaks-t.patch create mode 100644 vscode-paches/0052-fix-fix-treeshaking-script.patch create mode 100644 vscode-paches/0053-fix-fix-build.patch create mode 100644 vscode-paches/0054-fix-make-editor-types-build-until-it-s-fixed-by-MS.patch diff --git a/package-lock.json b/package-lock.json index a42d434a..e6bf0ba3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,29 +12,29 @@ "@microsoft/1ds-core-js": "^3.2.13", "@microsoft/1ds-post-js": "^3.2.13", "@parcel/watcher": "2.1.0", - "@rollup/pluginutils": "^5.1.0", + "@rollup/pluginutils": "^5.1.2", "@vscode/iconv-lite-umd": "0.7.0", - "@vscode/proxy-agent": "^0.23.0", + "@vscode/proxy-agent": "^0.22.0", "@vscode/ripgrep": "^1.15.9", "@vscode/spdlog": "^0.15.0", "@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.39", - "@xterm/addon-image": "0.9.0-beta.56", - "@xterm/addon-search": "0.16.0-beta.56", - "@xterm/addon-serialize": "0.14.0-beta.56", - "@xterm/addon-unicode11": "0.9.0-beta.56", - "@xterm/addon-webgl": "0.19.0-beta.56", - "@xterm/headless": "5.6.0-beta.56", - "@xterm/xterm": "5.6.0-beta.56", + "@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", "css-url-parser": "^1.1.4", "jschardet": "3.1.3", "kerberos": "2.1.1", "keytar": "^7.9.0", "marked": "~14.0.0", - "memfs": "^4.11.1", + "memfs": "^4.12.0", "mime-types": "^2.1.35", "node-pty": "1.1.0-beta21", "vscode-oniguruma": "1.7.0", @@ -44,26 +44,26 @@ "yazl": "^2.4.3" }, "devDependencies": { - "@babel/core": "^7.25.2", + "@babel/core": "^7.25.7", "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-decorators": "^7.24.7", - "@babel/preset-env": "^7.25.4", - "@babel/preset-typescript": "^7.24.7", + "@babel/plugin-proposal-decorators": "^7.25.7", + "@babel/preset-env": "^7.25.7", + "@babel/preset-typescript": "^7.25.7", "@codingame/commitlint-config-codingame": "^1.1.1", "@codingame/eslint-config": "^1.2.1", "@codingame/semantic-release-config-github": "^1.0.0", "@codingame/tsconfig": "^1.1.1", "@commitlint/cli": "^19.5.0", - "@rollup/plugin-commonjs": "^26.0.1", - "@rollup/plugin-dynamic-import-vars": "^2.1.2", + "@rollup/plugin-commonjs": "^28.0.0", + "@rollup/plugin-dynamic-import-vars": "^2.1.3", "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-replace": "^5.0.7", - "@rollup/plugin-typescript": "^11.1.6", + "@rollup/plugin-node-resolve": "^15.3.0", + "@rollup/plugin-replace": "^6.0.1", + "@rollup/plugin-typescript": "^12.1.0", "@types/mime-types": "^2.1.4", "@types/node": "18.19.8", "@types/semver": "^7.5.8", - "@types/vscode": "~1.93.0", + "@types/vscode": "~1.94.0", "@types/vscode-semver": "npm:@types/semver@=5.5.0", "@types/yargs": "^17.0.33", "@types/yauzl": "^2.10.3", @@ -85,7 +85,7 @@ "pascal-case": "^3.1.2", "patch-package": "^8.0.0", "recast": "^0.23.9", - "rollup": "^4.21.3", + "rollup": "^4.24.0", "rollup-plugin-copy": "^3.5.0", "rollup-plugin-dts": "^6.1.1", "rollup-plugin-styles": "^4.0.0", @@ -97,7 +97,7 @@ "typescript": "^5.6.2", "vscode-semver": "npm:semver@=5.5.0", "yargs": "^17.7.2", - "zx": "^8.1.6" + "zx": "^8.1.9" } }, "node_modules/@ampproject/remapping": { @@ -114,12 +114,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", - "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", + "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", "dev": true, "dependencies": { - "@babel/highlight": "^7.24.7", + "@babel/highlight": "^7.25.7", "picocolors": "^1.0.0" }, "engines": { @@ -127,30 +127,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.4.tgz", - "integrity": "sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.7.tgz", + "integrity": "sha512-9ickoLz+hcXCeh7jrcin+/SLWm+GkxE2kTvoYyp38p4WkdFXfQJxDFGWp/YHjiKLPx06z2A7W8XKuqbReXDzsw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.2.tgz", - "integrity": "sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.7.tgz", + "integrity": "sha512-yJ474Zv3cwiSOO9nXJuqzvwEeM+chDuQ8GJirw+pZ91sCGCyOZ3dJkVE09fTV0VEVzXyLWhh3G/AolYTPX7Mow==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.25.0", - "@babel/helper-compilation-targets": "^7.25.2", - "@babel/helper-module-transforms": "^7.25.2", - "@babel/helpers": "^7.25.0", - "@babel/parser": "^7.25.0", - "@babel/template": "^7.25.0", - "@babel/traverse": "^7.25.2", - "@babel/types": "^7.25.2", + "@babel/code-frame": "^7.25.7", + "@babel/generator": "^7.25.7", + "@babel/helper-compilation-targets": "^7.25.7", + "@babel/helper-module-transforms": "^7.25.7", + "@babel/helpers": "^7.25.7", + "@babel/parser": "^7.25.7", + "@babel/template": "^7.25.7", + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -175,54 +175,54 @@ } }, "node_modules/@babel/generator": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.6.tgz", - "integrity": "sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz", + "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", "dev": true, "dependencies": { - "@babel/types": "^7.25.6", + "@babel/types": "^7.25.7", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^2.5.1" + "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.24.7.tgz", - "integrity": "sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.7.tgz", + "integrity": "sha512-4xwU8StnqnlIhhioZf1tqnVWeQ9pvH/ujS8hRfw/WOza+/a+1qv69BWNy+oY231maTCWgKWhfBU7kDpsds6zAA==", "dev": true, "dependencies": { - "@babel/types": "^7.24.7" + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.24.7.tgz", - "integrity": "sha512-xZeCVVdwb4MsDBkkyZ64tReWYrLRHlMN72vP7Bdm3OUOuyFZExhsHUUnuWnm2/XOlAJzR0LfPpB56WXZn0X/lA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.25.7.tgz", + "integrity": "sha512-12xfNeKNH7jubQNm7PAkzlLwEmCs1tfuX3UjIw6vP6QXi+leKh6+LyC/+Ed4EIQermwd58wsyh070yjDHFlNGg==", "dev": true, "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz", - "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.7.tgz", + "integrity": "sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.25.2", - "@babel/helper-validator-option": "^7.24.8", - "browserslist": "^4.23.1", + "@babel/compat-data": "^7.25.7", + "@babel/helper-validator-option": "^7.25.7", + "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -240,17 +240,17 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.4.tgz", - "integrity": "sha512-ro/bFs3/84MDgDmMwbcHgDa8/E6J3QKNTk4xJJnVeFtGE+tL0K26E3pNxhYz2b67fJpt7Aphw5XcploKXuCvCQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.7.tgz", + "integrity": "sha512-bD4WQhbkx80mAyj/WCm4ZHcF4rDxkoLFO6ph8/5/mQ3z4vAzltQXAmbc7GvVJx5H+lk5Mi5EmbTeox5nMGCsbw==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-member-expression-to-functions": "^7.24.8", - "@babel/helper-optimise-call-expression": "^7.24.7", - "@babel/helper-replace-supers": "^7.25.0", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/traverse": "^7.25.4", + "@babel/helper-annotate-as-pure": "^7.25.7", + "@babel/helper-member-expression-to-functions": "^7.25.7", + "@babel/helper-optimise-call-expression": "^7.25.7", + "@babel/helper-replace-supers": "^7.25.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.7", + "@babel/traverse": "^7.25.7", "semver": "^6.3.1" }, "engines": { @@ -270,13 +270,13 @@ } }, "node_modules/@babel/helper-create-regexp-features-plugin": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.2.tgz", - "integrity": "sha512-+wqVGP+DFmqwFD3EH6TMTfUNeqDehV3E/dl+Sd54eaXqm17tEUNbEIn4sVivVowbvUpOtIGxdo3GoXyDH9N/9g==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.25.7.tgz", + "integrity": "sha512-byHhumTj/X47wJ6C6eLpK7wW/WBEcnUeb7D0FNc/jFQnQVw7DOso3Zz5u9x/zLrFVkHa89ZGDbkAa1D54NdrCQ==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "regexpu-core": "^5.3.1", + "@babel/helper-annotate-as-pure": "^7.25.7", + "regexpu-core": "^6.1.1", "semver": "^6.3.1" }, "engines": { @@ -312,41 +312,41 @@ } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.24.8.tgz", - "integrity": "sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.7.tgz", + "integrity": "sha512-O31Ssjd5K6lPbTX9AAYpSKrZmLeagt9uwschJd+Ixo6QiRyfpvgtVQp8qrDR9UNFjZ8+DO34ZkdrN+BnPXemeA==", "dev": true, "dependencies": { - "@babel/traverse": "^7.24.8", - "@babel/types": "^7.24.8" + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", - "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.7.tgz", + "integrity": "sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==", "dev": true, "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz", - "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.7.tgz", + "integrity": "sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.24.7", - "@babel/helper-simple-access": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7", - "@babel/traverse": "^7.25.2" + "@babel/helper-module-imports": "^7.25.7", + "@babel/helper-simple-access": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.7", + "@babel/traverse": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -356,35 +356,35 @@ } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.24.7.tgz", - "integrity": "sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.7.tgz", + "integrity": "sha512-VAwcwuYhv/AT+Vfr28c9y6SHzTan1ryqrydSTFGjU0uDJHw3uZ+PduI8plCLkRsDnqK2DMEDmwrOQRsK/Ykjng==", "dev": true, "dependencies": { - "@babel/types": "^7.24.7" + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", - "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz", + "integrity": "sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-remap-async-to-generator": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.0.tgz", - "integrity": "sha512-NhavI2eWEIz/H9dbrG0TuOicDhNexze43i5z7lEqwYm0WEZVTwnPpA0EafUTP7+6/W79HWIP2cTe3Z5NiSTVpw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.25.7.tgz", + "integrity": "sha512-kRGE89hLnPfcz6fTrlNU+uhgcwv0mBE4Gv3P9Ke9kLVJYpi4AMVVEElXvB5CabrPZW4nCM8P8UyyjrzCM0O2sw==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-wrap-function": "^7.25.0", - "@babel/traverse": "^7.25.0" + "@babel/helper-annotate-as-pure": "^7.25.7", + "@babel/helper-wrap-function": "^7.25.7", + "@babel/traverse": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -394,14 +394,14 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.0.tgz", - "integrity": "sha512-q688zIvQVYtZu+i2PsdIu/uWGRpfxzr5WESsfpShfZECkO+d2o+WROWezCi/Q6kJ0tfPa5+pUGUlfx2HhrA3Bg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.7.tgz", + "integrity": "sha512-iy8JhqlUW9PtZkd4pHM96v6BdJ66Ba9yWSE4z0W4TvSZwLBPkyDsiIU3ENe4SmrzRBs76F7rQXTy1lYC49n6Lw==", "dev": true, "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.24.8", - "@babel/helper-optimise-call-expression": "^7.24.7", - "@babel/traverse": "^7.25.0" + "@babel/helper-member-expression-to-functions": "^7.25.7", + "@babel/helper-optimise-call-expression": "^7.25.7", + "@babel/traverse": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -411,92 +411,92 @@ } }, "node_modules/@babel/helper-simple-access": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", - "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.7.tgz", + "integrity": "sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==", "dev": true, "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.24.7.tgz", - "integrity": "sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.7.tgz", + "integrity": "sha512-pPbNbchZBkPMD50K0p3JGcFMNLVUCuU/ABybm/PGNj4JiHrpmNyqqCphBk4i19xXtNV0JhldQJJtbSW5aUvbyA==", "dev": true, "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", - "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", + "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", + "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", - "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.7.tgz", + "integrity": "sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-wrap-function": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.0.tgz", - "integrity": "sha512-s6Q1ebqutSiZnEjaofc/UKDyC4SbzV5n5SrA2Gq8UawLycr3i04f1dX4OzoQVnexm6aOCh37SQNYlJ/8Ku+PMQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.25.7.tgz", + "integrity": "sha512-MA0roW3JF2bD1ptAaJnvcabsVlNQShUaThyJbCDD4bCp8NEgiFvpoqRI2YS22hHlc2thjO/fTg2ShLMC3jygAg==", "dev": true, "dependencies": { - "@babel/template": "^7.25.0", - "@babel/traverse": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/template": "^7.25.7", + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.6.tgz", - "integrity": "sha512-Xg0tn4HcfTijTwfDwYlvVCl43V6h4KyVVX2aEm4qdO/PC6L2YvzLHFdmxhoeSA3eslcE6+ZVXHgWwopXYLNq4Q==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.7.tgz", + "integrity": "sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==", "dev": true, "dependencies": { - "@babel/template": "^7.25.0", - "@babel/types": "^7.25.6" + "@babel/template": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", - "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", + "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", + "@babel/helper-validator-identifier": "^7.25.7", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -506,12 +506,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", - "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.7.tgz", + "integrity": "sha512-aZn7ETtQsjjGG5HruveUK06cU3Hljuhd9Iojm4M8WWv3wLE6OkE5PWbDUkItmMgegmccaITudyuW5RPYrYlgWw==", "dev": true, "dependencies": { - "@babel/types": "^7.25.6" + "@babel/types": "^7.25.7" }, "bin": { "parser": "bin/babel-parser.js" @@ -521,13 +521,13 @@ } }, "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { - "version": "7.25.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.3.tgz", - "integrity": "sha512-wUrcsxZg6rqBXG05HG1FPYgsP6EvwF4WpBbxIpWIIYnH8wG0gzx3yZY3dtEHas4sTAOGkbTsc9EGPxwff8lRoA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.25.7.tgz", + "integrity": "sha512-UV9Lg53zyebzD1DwQoT9mzkEKa922LNUp5YkTJ6Uta0RbyXaQNUgcvSt7qIu1PpPzVb6rd10OVNTzkyBGeVmxQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/traverse": "^7.25.3" + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/traverse": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -537,12 +537,12 @@ } }, "node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.0.tgz", - "integrity": "sha512-Bm4bH2qsX880b/3ziJ8KD711LT7z4u8CFudmjqle65AZj/HNUFhEf90dqYv6O86buWvSBmeQDjv0Tn2aF/bIBA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-class-field-initializer-scope/-/plugin-bugfix-safari-class-field-initializer-scope-7.25.7.tgz", + "integrity": "sha512-GDDWeVLNxRIkQTnJn2pDOM1pkCgYdSqPeT1a9vh9yIqu2uzzgw1zcqEb+IJOhy+dTBMlNdThrDIksr2o09qrrQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -552,12 +552,12 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.0.tgz", - "integrity": "sha512-lXwdNZtTmeVOOFtwM/WDe7yg1PL8sYhRk/XH0FzbR2HDQ0xC+EnQ/JHeoMYSavtU115tnUk0q9CDyq8si+LMAA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.25.7.tgz", + "integrity": "sha512-wxyWg2RYaSUYgmd9MR0FyRGyeOMQE/Uzr1wzd/g5cf5bwi9A4v6HFdDm7y1MgDtod/fLOSTZY6jDgV0xU9d5bA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -567,14 +567,14 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.24.7.tgz", - "integrity": "sha512-+izXIbke1T33mY4MSNnrqhPXDz01WYhEf3yF5NbnUtkiNnm+XBZJl3kNfoK6NKmYlz/D07+l2GWVK/QfDkNCuQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.25.7.tgz", + "integrity": "sha512-Xwg6tZpLxc4iQjorYsyGMyfJE7nP5MV8t/Ka58BgiA7Jw0fRqQNcANlLfdJ/yvBt9z9LD2We+BEkT7vLqZRWng==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/plugin-transform-optional-chaining": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.7", + "@babel/plugin-transform-optional-chaining": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -584,13 +584,13 @@ } }, "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.0.tgz", - "integrity": "sha512-tggFrk1AIShG/RUQbEwt2Tr/E+ObkfwrPjR6BjbRvsx24+PSjK8zrq0GWPNCjo8qpRx4DuJzlcvWJqlm+0h3kw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.25.7.tgz", + "integrity": "sha512-UVATLMidXrnH+GMUIuxq55nejlj02HP7F5ETyBONzP6G87fPBogG4CH6kxrSrdIuAjdwNO9VzyaYsrZPscWUrw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/traverse": "^7.25.0" + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/traverse": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -617,14 +617,14 @@ } }, "node_modules/@babel/plugin-proposal-decorators": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.24.7.tgz", - "integrity": "sha512-RL9GR0pUG5Kc8BUWLNDm2T5OpYwSX15r98I0IkgmRQTXuELq/OynH8xtMTMvTJFjXbMWFVTKtYkTaYQsuAwQlQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.25.7.tgz", + "integrity": "sha512-q1mqqqH0e1lhmsEQHV5U8OmdueBC2y0RFr2oUzZoFRtN3MvPmt2fsFRcNQAoGLTSNdHBFUYGnlgcRFhkBbKjPw==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/plugin-syntax-decorators": "^7.24.7" + "@babel/helper-create-class-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/plugin-syntax-decorators": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -685,12 +685,12 @@ } }, "node_modules/@babel/plugin-syntax-decorators": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.24.7.tgz", - "integrity": "sha512-Ui4uLJJrRV1lb38zg1yYTmRKmiZLiftDEvZN2iq3kd9kUFU+PttmzTbAFC2ucRk/XJmtek6G23gPsuZbhrT8fQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.25.7.tgz", + "integrity": "sha512-oXduHo642ZhstLVYTe2z2GSJIruU0c/W3/Ghr6A5yGMsVrvdnxO1z+3pbTcT7f3/Clnt+1z8D/w1r1f1SHaCHw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -724,12 +724,12 @@ } }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.25.6.tgz", - "integrity": "sha512-aABl0jHw9bZ2karQ/uUD6XP4u0SG22SJrOHFoL6XB1R7dTovOP4TzTlsxOYC5yQ1pdscVK2JTUnF6QL3ARoAiQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.25.7.tgz", + "integrity": "sha512-ZvZQRmME0zfJnDQnVBKYzHxXT7lYBB3Revz1GuS7oLXWMgqUPX4G+DDbT30ICClht9WKV34QVrZhSw6WdklwZQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -739,12 +739,12 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.6.tgz", - "integrity": "sha512-sXaDXaJN9SNLymBdlWFA+bjzBhFD617ZaFiY13dGt7TVslVvVgA6fkZOP7Ki3IGElC45lwHdOTrCtKZGVAWeLQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.7.tgz", + "integrity": "sha512-AqVo+dguCgmpi/3mYBdu9lkngOBlQ2w2vnNpa6gfiCxQZLzV4ZbhsXitJ2Yblkoe1VQwtHSaNmIaGll/26YWRw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -778,12 +778,12 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.7.tgz", - "integrity": "sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.7.tgz", + "integrity": "sha512-ruZOnKO+ajVL/MVx+PwNBPOkrnXTXoWMtte1MBpegfCArhqOe3Bj52avVj1huLLxNKYKXYaSxZ2F+woK1ekXfw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -895,12 +895,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.4.tgz", - "integrity": "sha512-uMOCoHVU52BsSWxPOMVv5qKRdeSlPuImUCB2dlPuBSU+W2/ROE7/Zg8F2Kepbk+8yBa68LlRKxO+xgEVWorsDg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.7.tgz", + "integrity": "sha512-rR+5FDjpCHqqZN2bzZm18bVYGaejGq5ZkpVCJLXor/+zlSrSoc4KWcHI0URVWjl/68Dyr1uwZUz/1njycEAv9g==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -926,12 +926,12 @@ } }, "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.24.7.tgz", - "integrity": "sha512-Dt9LQs6iEY++gXUwY03DNFat5C2NbO48jj+j/bSAz6b3HgPs39qcPiYt77fDObIcFwj3/C2ICX9YMwGflUoSHQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.25.7.tgz", + "integrity": "sha512-EJN2mKxDwfOUCPxMO6MUI58RN3ganiRAG/MS/S3HfB6QFNjroAMelQo/gybyYq97WerCBAZoyrAoW8Tzdq2jWg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -941,15 +941,15 @@ } }, "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.4.tgz", - "integrity": "sha512-jz8cV2XDDTqjKPwVPJBIjORVEmSGYhdRa8e5k5+vN+uwcjSrSxUaebBRa4ko1jqNF2uxyg8G6XYk30Jv285xzg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.25.7.tgz", + "integrity": "sha512-4B6OhTrwYKHYYgcwErvZjbmH9X5TxQBsaBHdzEIB4l71gR5jh/tuHGlb9in47udL2+wVUcOz5XXhhfhVJwEpEg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-remap-async-to-generator": "^7.25.0", + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-remap-async-to-generator": "^7.25.7", "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/traverse": "^7.25.4" + "@babel/traverse": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -959,14 +959,14 @@ } }, "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.24.7.tgz", - "integrity": "sha512-SQY01PcJfmQ+4Ash7NE+rpbLFbmqA2GPIgqzxfFTL4t1FKRq4zTms/7htKpoCUI9OcFYgzqfmCdH53s6/jn5fA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.25.7.tgz", + "integrity": "sha512-ZUCjAavsh5CESCmi/xCpX1qcCaAglzs/7tmuvoFnJgA1dM7gQplsguljoTg+Ru8WENpX89cQyAtWoaE0I3X3Pg==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-remap-async-to-generator": "^7.24.7" + "@babel/helper-module-imports": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-remap-async-to-generator": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -976,12 +976,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.24.7.tgz", - "integrity": "sha512-yO7RAz6EsVQDaBH18IDJcMB1HnrUn2FJ/Jslc/WtPPWcjhpUJXU/rjbwmluzp7v/ZzWcEhTMXELnnsz8djWDwQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.25.7.tgz", + "integrity": "sha512-xHttvIM9fvqW+0a3tZlYcZYSBpSWzGBFIt/sYG3tcdSzBB8ZeVgz2gBP7Df+sM0N1850jrviYSSeUuc+135dmQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -991,12 +991,12 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.0.tgz", - "integrity": "sha512-yBQjYoOjXlFv9nlXb3f1casSHOZkWr29NX+zChVanLg5Nc157CrbEX9D7hxxtTpuFy7Q0YzmmWfJxzvps4kXrQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.25.7.tgz", + "integrity": "sha512-ZEPJSkVZaeTFG/m2PARwLZQ+OG0vFIhPlKHK/JdIMy8DbRJ/htz6LRrTFtdzxi9EHmcwbNPAKDnadpNSIW+Aow==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1006,13 +1006,13 @@ } }, "node_modules/@babel/plugin-transform-class-properties": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.4.tgz", - "integrity": "sha512-nZeZHyCWPfjkdU5pA/uHiTaDAFUEqkpzf1YoQT2NeSynCGYq9rxfyI3XpQbfx/a0hSnFH6TGlEXvae5Vi7GD8g==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.25.7.tgz", + "integrity": "sha512-mhyfEW4gufjIqYFo9krXHJ3ElbFLIze5IDp+wQTxoPd+mwFb1NxatNAwmv8Q8Iuxv7Zc+q8EkiMQwc9IhyGf4g==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.25.4", - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-create-class-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1022,13 +1022,13 @@ } }, "node_modules/@babel/plugin-transform-class-static-block": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.24.7.tgz", - "integrity": "sha512-HMXK3WbBPpZQufbMG4B46A90PkuuhN9vBCb5T8+VAHqvAqvcLi+2cKoukcpmUYkszLhScU3l1iudhrks3DggRQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.25.7.tgz", + "integrity": "sha512-rvUUtoVlkDWtDWxGAiiQj0aNktTPn3eFynBcMC2IhsXweehwgdI9ODe+XjWw515kEmv22sSOTp/rxIRuTiB7zg==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-create-class-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7", "@babel/plugin-syntax-class-static-block": "^7.14.5" }, "engines": { @@ -1039,16 +1039,16 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.4.tgz", - "integrity": "sha512-oexUfaQle2pF/b6E0dwsxQtAol9TLSO88kQvym6HHBWFliV2lGdrPieX+WgMRLSJDVzdYywk7jXbLPuO2KLTLg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.25.7.tgz", + "integrity": "sha512-9j9rnl+YCQY0IGoeipXvnk3niWicIB6kCsWRGLwX241qSXpbA4MKxtp/EdvFxsc4zI5vqfLxzOd0twIJ7I99zg==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-compilation-targets": "^7.25.2", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-replace-supers": "^7.25.0", - "@babel/traverse": "^7.25.4", + "@babel/helper-annotate-as-pure": "^7.25.7", + "@babel/helper-compilation-targets": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-replace-supers": "^7.25.7", + "@babel/traverse": "^7.25.7", "globals": "^11.1.0" }, "engines": { @@ -1059,13 +1059,13 @@ } }, "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.24.7.tgz", - "integrity": "sha512-25cS7v+707Gu6Ds2oY6tCkUwsJ9YIDbggd9+cu9jzzDgiNq7hR/8dkzxWfKWnTic26vsI3EsCXNd4iEB6e8esQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.25.7.tgz", + "integrity": "sha512-QIv+imtM+EtNxg/XBKL3hiWjgdLjMOmZ+XzQwSgmBfKbfxUjBzGgVPklUuE55eq5/uVoh8gg3dqlrwR/jw3ZeA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/template": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/template": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1075,12 +1075,12 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.24.8.tgz", - "integrity": "sha512-36e87mfY8TnRxc7yc6M9g9gOB7rKgSahqkIKwLpz4Ppk2+zC2Cy1is0uwtuSG6AE4zlTOUa+7JGz9jCJGLqQFQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.25.7.tgz", + "integrity": "sha512-xKcfLTlJYUczdaM1+epcdh1UGewJqr9zATgrNHcLBcV2QmfvPPEixo/sK/syql9cEmbr7ulu5HMFG5vbbt/sEA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1090,13 +1090,13 @@ } }, "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.24.7.tgz", - "integrity": "sha512-ZOA3W+1RRTSWvyqcMJDLqbchh7U4NRGqwRfFSVbOLS/ePIP4vHB5e8T8eXcuqyN1QkgKyj5wuW0lcS85v4CrSw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.25.7.tgz", + "integrity": "sha512-kXzXMMRzAtJdDEgQBLF4oaiT6ZCU3oWHgpARnTKDAqPkDJ+bs3NrZb310YYevR5QlRo3Kn7dzzIdHbZm1VzJdQ==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1106,12 +1106,12 @@ } }, "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.24.7.tgz", - "integrity": "sha512-JdYfXyCRihAe46jUIliuL2/s0x0wObgwwiGxw/UbgJBr20gQBThrokO4nYKgWkD7uBaqM7+9x5TU7NkExZJyzw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.25.7.tgz", + "integrity": "sha512-by+v2CjoL3aMnWDOyCIg+yxU9KXSRa9tN6MbqggH5xvymmr9p4AMjYkNlQy4brMceBnUyHZ9G8RnpvT8wP7Cfg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1121,13 +1121,13 @@ } }, "node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.0.tgz", - "integrity": "sha512-YLpb4LlYSc3sCUa35un84poXoraOiQucUTTu8X1j18JV+gNa8E0nyUf/CjZ171IRGr4jEguF+vzJU66QZhn29g==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.25.7.tgz", + "integrity": "sha512-HvS6JF66xSS5rNKXLqkk7L9c/jZ/cdIVIcoPVrnl8IsVpLggTjXs8OWekbLHs/VtYDDh5WXnQyeE3PPUGm22MA==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.0", - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-create-regexp-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1137,12 +1137,12 @@ } }, "node_modules/@babel/plugin-transform-dynamic-import": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.24.7.tgz", - "integrity": "sha512-sc3X26PhZQDb3JhORmakcbvkeInvxz+A8oda99lj7J60QRuPZvNAk9wQlTBS1ZynelDrDmTU4pw1tyc5d5ZMUg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.25.7.tgz", + "integrity": "sha512-UvcLuual4h7/GfylKm2IAA3aph9rwvAM2XBA0uPKU3lca+Maai4jBjjEVUS568ld6kJcgbouuumCBhMd/Yz17w==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.25.7", "@babel/plugin-syntax-dynamic-import": "^7.8.3" }, "engines": { @@ -1153,13 +1153,13 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.24.7.tgz", - "integrity": "sha512-Rqe/vSc9OYgDajNIK35u7ot+KeCoetqQYFXM4Epf7M7ez3lWlOjrDjrwMei6caCVhfdw+mIKD4cgdGNy5JQotQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.25.7.tgz", + "integrity": "sha512-yjqtpstPfZ0h/y40fAXRv2snciYr0OAoMXY/0ClC7tm4C/nG5NJKmIItlaYlLbIVAWNfrYuy9dq1bE0SbX0PEg==", "dev": true, "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1169,12 +1169,12 @@ } }, "node_modules/@babel/plugin-transform-export-namespace-from": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.24.7.tgz", - "integrity": "sha512-v0K9uNYsPL3oXZ/7F9NNIbAj2jv1whUEtyA6aujhekLs56R++JDQuzRcP2/z4WX5Vg/c5lE9uWZA0/iUoFhLTA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.25.7.tgz", + "integrity": "sha512-h3MDAP5l34NQkkNulsTNyjdaR+OiB0Im67VU//sFupouP8Q6m9Spy7l66DcaAQxtmCqGdanPByLsnwFttxKISQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.25.7", "@babel/plugin-syntax-export-namespace-from": "^7.8.3" }, "engines": { @@ -1185,13 +1185,13 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.24.7.tgz", - "integrity": "sha512-wo9ogrDG1ITTTBsy46oGiN1dS9A7MROBTcYsfS8DtsImMkHk9JXJ3EWQM6X2SUw4x80uGPlwj0o00Uoc6nEE3g==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.25.7.tgz", + "integrity": "sha512-n/TaiBGJxYFWvpJDfsxSj9lEEE44BFM1EPGz4KEiTipTgkoFVVcCmzAL3qA7fdQU96dpo4gGf5HBx/KnDvqiHw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1201,14 +1201,14 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.25.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.1.tgz", - "integrity": "sha512-TVVJVdW9RKMNgJJlLtHsKDTydjZAbwIsn6ySBPQaEAUU5+gVvlJt/9nRmqVbsV/IBanRjzWoaAQKLoamWVOUuA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.25.7.tgz", + "integrity": "sha512-5MCTNcjCMxQ63Tdu9rxyN6cAWurqfrDZ76qvVPrGYdBxIj+EawuuxTu/+dgJlhK5eRz3v1gLwp6XwS8XaX2NiQ==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.24.8", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/traverse": "^7.25.1" + "@babel/helper-compilation-targets": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/traverse": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1218,12 +1218,12 @@ } }, "node_modules/@babel/plugin-transform-json-strings": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.24.7.tgz", - "integrity": "sha512-2yFnBGDvRuxAaE/f0vfBKvtnvvqU8tGpMHqMNpTN2oWMKIR3NqFkjaAgGwawhqK/pIN2T3XdjGPdaG0vDhOBGw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.25.7.tgz", + "integrity": "sha512-Ot43PrL9TEAiCe8C/2erAjXMeVSnE/BLEx6eyrKLNFCCw5jvhTHKyHxdI1pA0kz5njZRYAnMO2KObGqOCRDYSA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.25.7", "@babel/plugin-syntax-json-strings": "^7.8.3" }, "engines": { @@ -1234,12 +1234,12 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.2.tgz", - "integrity": "sha512-HQI+HcTbm9ur3Z2DkO+jgESMAMcYLuN/A7NRw9juzxAezN9AvqvUTnpKP/9kkYANz6u7dFlAyOu44ejuGySlfw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.25.7.tgz", + "integrity": "sha512-fwzkLrSu2fESR/cm4t6vqd7ebNIopz2QHGtjoU+dswQo/P6lwAG04Q98lliE3jkz/XqnbGFLnUcE0q0CVUf92w==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1249,12 +1249,12 @@ } }, "node_modules/@babel/plugin-transform-logical-assignment-operators": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.24.7.tgz", - "integrity": "sha512-4D2tpwlQ1odXmTEIFWy9ELJcZHqrStlzK/dAOWYyxX3zT0iXQB6banjgeOJQXzEc4S0E0a5A+hahxPaEFYftsw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.25.7.tgz", + "integrity": "sha512-iImzbA55BjiovLyG2bggWS+V+OLkaBorNvc/yJoeeDQGztknRnDdYfp2d/UPmunZYEnZi6Lg8QcTmNMHOB0lGA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.25.7", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" }, "engines": { @@ -1265,12 +1265,12 @@ } }, "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.24.7.tgz", - "integrity": "sha512-T/hRC1uqrzXMKLQ6UCwMT85S3EvqaBXDGf0FaMf4446Qx9vKwlghvee0+uuZcDUCZU5RuNi4781UQ7R308zzBw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.25.7.tgz", + "integrity": "sha512-Std3kXwpXfRV0QtQy5JJcRpkqP8/wG4XL7hSKZmGlxPlDqmpXtEPRmhF7ztnlTCtUN3eXRUJp+sBEZjaIBVYaw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1280,13 +1280,13 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.24.7.tgz", - "integrity": "sha512-9+pB1qxV3vs/8Hdmz/CulFB8w2tuu6EB94JZFsjdqxQokwGa9Unap7Bo2gGBGIvPmDIVvQrom7r5m/TCDMURhg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.25.7.tgz", + "integrity": "sha512-CgselSGCGzjQvKzghCvDTxKHP3iooenLpJDO842ehn5D2G5fJB222ptnDwQho0WjEvg7zyoxb9P+wiYxiJX5yA==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-module-transforms": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1296,14 +1296,14 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.24.8.tgz", - "integrity": "sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.7.tgz", + "integrity": "sha512-L9Gcahi0kKFYXvweO6n0wc3ZG1ChpSFdgG+eV1WYZ3/dGbJK7vvk91FgGgak8YwRgrCuihF8tE/Xg07EkL5COg==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.24.8", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-simple-access": "^7.24.7" + "@babel/helper-module-transforms": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-simple-access": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1313,15 +1313,15 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.0.tgz", - "integrity": "sha512-YPJfjQPDXxyQWg/0+jHKj1llnY5f/R6a0p/vP4lPymxLu7Lvl4k2WMitqi08yxwQcCVUUdG9LCUj4TNEgAp3Jw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.25.7.tgz", + "integrity": "sha512-t9jZIvBmOXJsiuyOwhrIGs8dVcD6jDyg2icw1VL4A/g+FnWyJKwUfSSU2nwJuMV2Zqui856El9u+ElB+j9fV1g==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.25.0", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", - "@babel/traverse": "^7.25.0" + "@babel/helper-module-transforms": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.7", + "@babel/traverse": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1331,13 +1331,13 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.24.7.tgz", - "integrity": "sha512-3aytQvqJ/h9z4g8AsKPLvD4Zqi2qT+L3j7XoFFu1XBlZWEl2/1kWnhmAbxpLgPrHSY0M6UA02jyTiwUVtiKR6A==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.25.7.tgz", + "integrity": "sha512-p88Jg6QqsaPh+EB7I9GJrIqi1Zt4ZBHUQtjw3z1bzEXcLh6GfPqzZJ6G+G1HBGKUNukT58MnKG7EN7zXQBCODw==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-module-transforms": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1347,13 +1347,13 @@ } }, "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.24.7.tgz", - "integrity": "sha512-/jr7h/EWeJtk1U/uz2jlsCioHkZk1JJZVcc8oQsJ1dUlaJD83f4/6Zeh2aHt9BIFokHIsSeDfhUmju0+1GPd6g==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.25.7.tgz", + "integrity": "sha512-BtAT9LzCISKG3Dsdw5uso4oV1+v2NlVXIIomKJgQybotJY3OwCwJmkongjHgwGKoZXd0qG5UZ12JUlDQ07W6Ow==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1363,12 +1363,12 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.24.7.tgz", - "integrity": "sha512-RNKwfRIXg4Ls/8mMTza5oPF5RkOW8Wy/WgMAp1/F1yZ8mMbtwXW+HDoJiOsagWrAhI5f57Vncrmr9XeT4CVapA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.25.7.tgz", + "integrity": "sha512-CfCS2jDsbcZaVYxRFo2qtavW8SpdzmBXC2LOI4oO0rP+JSRDxxF3inF4GcPsLgfb5FjkhXG5/yR/lxuRs2pySA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1378,12 +1378,12 @@ } }, "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.24.7.tgz", - "integrity": "sha512-Ts7xQVk1OEocqzm8rHMXHlxvsfZ0cEF2yomUqpKENHWMF4zKk175Y4q8H5knJes6PgYad50uuRmt3UJuhBw8pQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.25.7.tgz", + "integrity": "sha512-FbuJ63/4LEL32mIxrxwYaqjJxpbzxPVQj5a+Ebrc8JICV6YX8nE53jY+K0RZT3um56GoNWgkS2BQ/uLGTjtwfw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.25.7", "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" }, "engines": { @@ -1394,12 +1394,12 @@ } }, "node_modules/@babel/plugin-transform-numeric-separator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.24.7.tgz", - "integrity": "sha512-e6q1TiVUzvH9KRvicuxdBTUj4AdKSRwzIyFFnfnezpCfP2/7Qmbb8qbU2j7GODbl4JMkblitCQjKYUaX/qkkwA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.25.7.tgz", + "integrity": "sha512-8CbutzSSh4hmD+jJHIA8vdTNk15kAzOnFLVVgBSMGr28rt85ouT01/rezMecks9pkU939wDInImwCKv4ahU4IA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.25.7", "@babel/plugin-syntax-numeric-separator": "^7.10.4" }, "engines": { @@ -1410,15 +1410,15 @@ } }, "node_modules/@babel/plugin-transform-object-rest-spread": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.24.7.tgz", - "integrity": "sha512-4QrHAr0aXQCEFni2q4DqKLD31n2DL+RxcwnNjDFkSG0eNQ/xCavnRkfCUjsyqGC2OviNJvZOF/mQqZBw7i2C5Q==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.25.7.tgz", + "integrity": "sha512-1JdVKPhD7Y5PvgfFy0Mv2brdrolzpzSoUq2pr6xsR+m+3viGGeHEokFKsCgOkbeFOQxfB1Vt2F0cPJLRpFI4Zg==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-compilation-targets": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.24.7" + "@babel/plugin-transform-parameters": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1428,13 +1428,13 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.24.7.tgz", - "integrity": "sha512-A/vVLwN6lBrMFmMDmPPz0jnE6ZGx7Jq7d6sT/Ev4H65RER6pZ+kczlf1DthF5N0qaPHBsI7UXiE8Zy66nmAovg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.25.7.tgz", + "integrity": "sha512-pWT6UXCEW3u1t2tcAGtE15ornCBvopHj9Bps9D2DsH15APgNVOTwwczGckX+WkAvBmuoYKRCFa4DK+jM8vh5AA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-replace-supers": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-replace-supers": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1444,12 +1444,12 @@ } }, "node_modules/@babel/plugin-transform-optional-catch-binding": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.24.7.tgz", - "integrity": "sha512-uLEndKqP5BfBbC/5jTwPxLh9kqPWWgzN/f8w6UwAIirAEqiIVJWWY312X72Eub09g5KF9+Zn7+hT7sDxmhRuKA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.25.7.tgz", + "integrity": "sha512-m9obYBA39mDPN7lJzD5WkGGb0GO54PPLXsbcnj1Hyeu8mSRz7Gb4b1A6zxNX32ZuUySDK4G6it8SDFWD1nCnqg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.25.7", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" }, "engines": { @@ -1460,13 +1460,13 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.24.8.tgz", - "integrity": "sha512-5cTOLSMs9eypEy8JUVvIKOu6NgvbJMnpG62VpIHrTmROdQ+L5mDAaI40g25k5vXti55JWNX5jCkq3HZxXBQANw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.25.7.tgz", + "integrity": "sha512-h39agClImgPWg4H8mYVAbD1qP9vClFbEjqoJmt87Zen8pjqK8FTPUwrOXAvqu5soytwxrLMd2fx2KSCp2CHcNg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.7", "@babel/plugin-syntax-optional-chaining": "^7.8.3" }, "engines": { @@ -1477,12 +1477,12 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.24.7.tgz", - "integrity": "sha512-yGWW5Rr+sQOhK0Ot8hjDJuxU3XLRQGflvT4lhlSY0DFvdb3TwKaY26CJzHtYllU0vT9j58hc37ndFPsqT1SrzA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.25.7.tgz", + "integrity": "sha512-FYiTvku63me9+1Nz7TOx4YMtW3tWXzfANZtrzHhUZrz4d47EEtMQhzFoZWESfXuAMMT5mwzD4+y1N8ONAX6lMQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1492,13 +1492,13 @@ } }, "node_modules/@babel/plugin-transform-private-methods": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.4.tgz", - "integrity": "sha512-ao8BG7E2b/URaUQGqN3Tlsg+M3KlHY6rJ1O1gXAEUnZoyNQnvKyH87Kfg+FoxSeyWUB8ISZZsC91C44ZuBFytw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.25.7.tgz", + "integrity": "sha512-KY0hh2FluNxMLwOCHbxVOKfdB5sjWG4M183885FmaqWWiGMhRZq4DQRKH6mHdEucbJnyDyYiZNwNG424RymJjA==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.25.4", - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-create-class-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1508,14 +1508,14 @@ } }, "node_modules/@babel/plugin-transform-private-property-in-object": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.24.7.tgz", - "integrity": "sha512-9z76mxwnwFxMyxZWEgdgECQglF2Q7cFLm0kMf8pGwt+GSJsY0cONKj/UuO4bOH0w/uAel3ekS4ra5CEAyJRmDA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.25.7.tgz", + "integrity": "sha512-LzA5ESzBy7tqj00Yjey9yWfs3FKy4EmJyKOSWld144OxkTji81WWnUT8nkLUn+imN/zHL8ZQlOu/MTUAhHaX3g==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-create-class-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-annotate-as-pure": "^7.25.7", + "@babel/helper-create-class-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7", "@babel/plugin-syntax-private-property-in-object": "^7.14.5" }, "engines": { @@ -1526,12 +1526,12 @@ } }, "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.24.7.tgz", - "integrity": "sha512-EMi4MLQSHfd2nrCqQEWxFdha2gBCqU4ZcCng4WBGZ5CJL4bBRW0ptdqqDdeirGZcpALazVVNJqRmsO8/+oNCBA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.25.7.tgz", + "integrity": "sha512-lQEeetGKfFi0wHbt8ClQrUSUMfEeI3MMm74Z73T9/kuz990yYVtfofjf3NuA42Jy3auFOpbjDyCSiIkTs1VIYw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1541,12 +1541,12 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.24.7.tgz", - "integrity": "sha512-lq3fvXPdimDrlg6LWBoqj+r/DEWgONuwjuOuQCSYgRroXDH/IdM1C0IZf59fL5cHLpjEH/O6opIRBbqv7ELnuA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.25.7.tgz", + "integrity": "sha512-mgDoQCRjrY3XK95UuV60tZlFCQGXEtMg8H+IsW72ldw1ih1jZhzYXbJvghmAEpg5UVhhnCeia1CkGttUvCkiMQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", + "@babel/helper-plugin-utils": "^7.25.7", "regenerator-transform": "^0.15.2" }, "engines": { @@ -1557,12 +1557,12 @@ } }, "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.24.7.tgz", - "integrity": "sha512-0DUq0pHcPKbjFZCfTss/pGkYMfy3vFWydkUBd9r0GHpIyfs2eCDENvqadMycRS9wZCXR41wucAfJHJmwA0UmoQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.25.7.tgz", + "integrity": "sha512-3OfyfRRqiGeOvIWSagcwUTVk2hXBsr/ww7bLn6TRTuXnexA+Udov2icFOxFX9abaj4l96ooYkcNN1qi2Zvqwng==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1572,12 +1572,12 @@ } }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.24.7.tgz", - "integrity": "sha512-KsDsevZMDsigzbA09+vacnLpmPH4aWjcZjXdyFKGzpplxhbeB4wYtury3vglQkg6KM/xEPKt73eCjPPf1PgXBA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.25.7.tgz", + "integrity": "sha512-uBbxNwimHi5Bv3hUccmOFlUy3ATO6WagTApenHz9KzoIdn0XeACdB12ZJ4cjhuB2WSi80Ez2FWzJnarccriJeA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1587,13 +1587,13 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.24.7.tgz", - "integrity": "sha512-x96oO0I09dgMDxJaANcRyD4ellXFLLiWhuwDxKZX5g2rWP1bTPkBSwCYv96VDXVT1bD9aPj8tppr5ITIh8hBng==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.25.7.tgz", + "integrity": "sha512-Mm6aeymI0PBh44xNIv/qvo8nmbkpZze1KvR8MkEqbIREDxoiWTi18Zr2jryfRMwDfVZF9foKh060fWgni44luw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1603,12 +1603,12 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.24.7.tgz", - "integrity": "sha512-kHPSIJc9v24zEml5geKg9Mjx5ULpfncj0wRpYtxbvKyTtHCYDkVE3aHQ03FrpEo4gEe2vrJJS1Y9CJTaThA52g==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.25.7.tgz", + "integrity": "sha512-ZFAeNkpGuLnAQ/NCsXJ6xik7Id+tHuS+NT+ue/2+rn/31zcdnupCdmunOizEaP0JsUmTFSTOPoQY7PkK2pttXw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1618,12 +1618,12 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.24.7.tgz", - "integrity": "sha512-AfDTQmClklHCOLxtGoP7HkeMw56k1/bTQjwsfhL6pppo/M4TOBSq+jjBUBLmV/4oeFg4GWMavIl44ZeCtmmZTw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.25.7.tgz", + "integrity": "sha512-SI274k0nUsFFmyQupiO7+wKATAmMFf8iFgq2O+vVFXZ0SV9lNfT1NGzBEhjquFmD8I9sqHLguH+gZVN3vww2AA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1633,12 +1633,12 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.24.8.tgz", - "integrity": "sha512-adNTUpDCVnmAE58VEqKlAA6ZBlNkMnWD0ZcW76lyNFN3MJniyGFZfNwERVk8Ap56MCnXztmDr19T4mPTztcuaw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.25.7.tgz", + "integrity": "sha512-OmWmQtTHnO8RSUbL0NTdtpbZHeNTnm68Gj5pA4Y2blFNh+V4iZR68V1qL9cI37J21ZN7AaCnkfdHtLExQPf2uA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1648,16 +1648,16 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.25.2.tgz", - "integrity": "sha512-lBwRvjSmqiMYe/pS0+1gggjJleUJi7NzjvQ1Fkqtt69hBa/0t1YuW/MLQMAPixfwaQOHUXsd6jeU3Z+vdGv3+A==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.25.7.tgz", + "integrity": "sha512-VKlgy2vBzj8AmEzunocMun2fF06bsSWV+FvVXohtL6FGve/+L217qhHxRTVGHEDO/YR8IANcjzgJsd04J8ge5Q==", "dev": true, "dependencies": { - "@babel/helper-annotate-as-pure": "^7.24.7", - "@babel/helper-create-class-features-plugin": "^7.25.0", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-skip-transparent-expression-wrappers": "^7.24.7", - "@babel/plugin-syntax-typescript": "^7.24.7" + "@babel/helper-annotate-as-pure": "^7.25.7", + "@babel/helper-create-class-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.7", + "@babel/plugin-syntax-typescript": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1667,12 +1667,12 @@ } }, "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.24.7.tgz", - "integrity": "sha512-U3ap1gm5+4edc2Q/P+9VrBNhGkfnf+8ZqppY71Bo/pzZmXhhLdqgaUl6cuB07O1+AQJtCLfaOmswiNbSQ9ivhw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.25.7.tgz", + "integrity": "sha512-BN87D7KpbdiABA+t3HbVqHzKWUDN3dymLaTnPFAMyc8lV+KN3+YzNhVRNdinaCPA4AUqx7ubXbQ9shRjYBl3SQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1682,13 +1682,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-property-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.24.7.tgz", - "integrity": "sha512-uH2O4OV5M9FZYQrwc7NdVmMxQJOCCzFeYudlZSzUAHRFeOujQefa92E74TQDVskNHCzOXoigEuoyzHDhaEaK5w==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.25.7.tgz", + "integrity": "sha512-IWfR89zcEPQGB/iB408uGtSPlQd3Jpq11Im86vUgcmSTcoWAiQMCTOa2K2yNNqFJEBVICKhayctee65Ka8OB0w==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1698,13 +1698,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.24.7.tgz", - "integrity": "sha512-hlQ96MBZSAXUq7ltkjtu3FJCCSMx/j629ns3hA3pXnBXjanNP0LHi+JpPeA81zaWgVK1VGH95Xuy7u0RyQ8kMg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.25.7.tgz", + "integrity": "sha512-8JKfg/hiuA3qXnlLx8qtv5HWRbgyFx2hMMtpDDuU2rTckpKkGu4ycK5yYHwuEa16/quXfoxHBIApEsNyMWnt0g==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.24.7", - "@babel/helper-plugin-utils": "^7.24.7" + "@babel/helper-create-regexp-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1714,13 +1714,13 @@ } }, "node_modules/@babel/plugin-transform-unicode-sets-regex": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.4.tgz", - "integrity": "sha512-qesBxiWkgN1Q+31xUE9RcMk79eOXXDCv6tfyGMRSs4RGlioSg2WVyQAm07k726cSE56pa+Kb0y9epX2qaXzTvA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.25.7.tgz", + "integrity": "sha512-YRW8o9vzImwmh4Q3Rffd09bH5/hvY0pxg+1H1i0f7APoUeg12G7+HhLj9ZFNIrYkgBXhIijPJ+IXypN0hLTIbw==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.25.2", - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-create-regexp-features-plugin": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1730,28 +1730,28 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.25.4.tgz", - "integrity": "sha512-W9Gyo+KmcxjGahtt3t9fb14vFRWvPpu5pT6GBlovAK6BTBcxgjfVMSQCfJl4oi35ODrxP6xx2Wr8LNST57Mraw==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.25.4", - "@babel/helper-compilation-targets": "^7.25.2", - "@babel/helper-plugin-utils": "^7.24.8", - "@babel/helper-validator-option": "^7.24.8", - "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.3", - "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.0", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.0", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.24.7", - "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.0", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.25.7.tgz", + "integrity": "sha512-Gibz4OUdyNqqLj+7OAvBZxOD7CklCtMA5/j0JgUEwOnaRULsPDXmic2iKxL2DX2vQduPR5wH2hjZas/Vr/Oc0g==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.25.7", + "@babel/helper-compilation-targets": "^7.25.7", + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-validator-option": "^7.25.7", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.25.7", + "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.25.7", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.25.7", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.25.7", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.25.7", "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", "@babel/plugin-syntax-class-static-block": "^7.14.5", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.24.7", - "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-assertions": "^7.25.7", + "@babel/plugin-syntax-import-attributes": "^7.25.7", "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", @@ -1763,60 +1763,60 @@ "@babel/plugin-syntax-private-property-in-object": "^7.14.5", "@babel/plugin-syntax-top-level-await": "^7.14.5", "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", - "@babel/plugin-transform-arrow-functions": "^7.24.7", - "@babel/plugin-transform-async-generator-functions": "^7.25.4", - "@babel/plugin-transform-async-to-generator": "^7.24.7", - "@babel/plugin-transform-block-scoped-functions": "^7.24.7", - "@babel/plugin-transform-block-scoping": "^7.25.0", - "@babel/plugin-transform-class-properties": "^7.25.4", - "@babel/plugin-transform-class-static-block": "^7.24.7", - "@babel/plugin-transform-classes": "^7.25.4", - "@babel/plugin-transform-computed-properties": "^7.24.7", - "@babel/plugin-transform-destructuring": "^7.24.8", - "@babel/plugin-transform-dotall-regex": "^7.24.7", - "@babel/plugin-transform-duplicate-keys": "^7.24.7", - "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.0", - "@babel/plugin-transform-dynamic-import": "^7.24.7", - "@babel/plugin-transform-exponentiation-operator": "^7.24.7", - "@babel/plugin-transform-export-namespace-from": "^7.24.7", - "@babel/plugin-transform-for-of": "^7.24.7", - "@babel/plugin-transform-function-name": "^7.25.1", - "@babel/plugin-transform-json-strings": "^7.24.7", - "@babel/plugin-transform-literals": "^7.25.2", - "@babel/plugin-transform-logical-assignment-operators": "^7.24.7", - "@babel/plugin-transform-member-expression-literals": "^7.24.7", - "@babel/plugin-transform-modules-amd": "^7.24.7", - "@babel/plugin-transform-modules-commonjs": "^7.24.8", - "@babel/plugin-transform-modules-systemjs": "^7.25.0", - "@babel/plugin-transform-modules-umd": "^7.24.7", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.24.7", - "@babel/plugin-transform-new-target": "^7.24.7", - "@babel/plugin-transform-nullish-coalescing-operator": "^7.24.7", - "@babel/plugin-transform-numeric-separator": "^7.24.7", - "@babel/plugin-transform-object-rest-spread": "^7.24.7", - "@babel/plugin-transform-object-super": "^7.24.7", - "@babel/plugin-transform-optional-catch-binding": "^7.24.7", - "@babel/plugin-transform-optional-chaining": "^7.24.8", - "@babel/plugin-transform-parameters": "^7.24.7", - "@babel/plugin-transform-private-methods": "^7.25.4", - "@babel/plugin-transform-private-property-in-object": "^7.24.7", - "@babel/plugin-transform-property-literals": "^7.24.7", - "@babel/plugin-transform-regenerator": "^7.24.7", - "@babel/plugin-transform-reserved-words": "^7.24.7", - "@babel/plugin-transform-shorthand-properties": "^7.24.7", - "@babel/plugin-transform-spread": "^7.24.7", - "@babel/plugin-transform-sticky-regex": "^7.24.7", - "@babel/plugin-transform-template-literals": "^7.24.7", - "@babel/plugin-transform-typeof-symbol": "^7.24.8", - "@babel/plugin-transform-unicode-escapes": "^7.24.7", - "@babel/plugin-transform-unicode-property-regex": "^7.24.7", - "@babel/plugin-transform-unicode-regex": "^7.24.7", - "@babel/plugin-transform-unicode-sets-regex": "^7.25.4", + "@babel/plugin-transform-arrow-functions": "^7.25.7", + "@babel/plugin-transform-async-generator-functions": "^7.25.7", + "@babel/plugin-transform-async-to-generator": "^7.25.7", + "@babel/plugin-transform-block-scoped-functions": "^7.25.7", + "@babel/plugin-transform-block-scoping": "^7.25.7", + "@babel/plugin-transform-class-properties": "^7.25.7", + "@babel/plugin-transform-class-static-block": "^7.25.7", + "@babel/plugin-transform-classes": "^7.25.7", + "@babel/plugin-transform-computed-properties": "^7.25.7", + "@babel/plugin-transform-destructuring": "^7.25.7", + "@babel/plugin-transform-dotall-regex": "^7.25.7", + "@babel/plugin-transform-duplicate-keys": "^7.25.7", + "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.25.7", + "@babel/plugin-transform-dynamic-import": "^7.25.7", + "@babel/plugin-transform-exponentiation-operator": "^7.25.7", + "@babel/plugin-transform-export-namespace-from": "^7.25.7", + "@babel/plugin-transform-for-of": "^7.25.7", + "@babel/plugin-transform-function-name": "^7.25.7", + "@babel/plugin-transform-json-strings": "^7.25.7", + "@babel/plugin-transform-literals": "^7.25.7", + "@babel/plugin-transform-logical-assignment-operators": "^7.25.7", + "@babel/plugin-transform-member-expression-literals": "^7.25.7", + "@babel/plugin-transform-modules-amd": "^7.25.7", + "@babel/plugin-transform-modules-commonjs": "^7.25.7", + "@babel/plugin-transform-modules-systemjs": "^7.25.7", + "@babel/plugin-transform-modules-umd": "^7.25.7", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.25.7", + "@babel/plugin-transform-new-target": "^7.25.7", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.25.7", + "@babel/plugin-transform-numeric-separator": "^7.25.7", + "@babel/plugin-transform-object-rest-spread": "^7.25.7", + "@babel/plugin-transform-object-super": "^7.25.7", + "@babel/plugin-transform-optional-catch-binding": "^7.25.7", + "@babel/plugin-transform-optional-chaining": "^7.25.7", + "@babel/plugin-transform-parameters": "^7.25.7", + "@babel/plugin-transform-private-methods": "^7.25.7", + "@babel/plugin-transform-private-property-in-object": "^7.25.7", + "@babel/plugin-transform-property-literals": "^7.25.7", + "@babel/plugin-transform-regenerator": "^7.25.7", + "@babel/plugin-transform-reserved-words": "^7.25.7", + "@babel/plugin-transform-shorthand-properties": "^7.25.7", + "@babel/plugin-transform-spread": "^7.25.7", + "@babel/plugin-transform-sticky-regex": "^7.25.7", + "@babel/plugin-transform-template-literals": "^7.25.7", + "@babel/plugin-transform-typeof-symbol": "^7.25.7", + "@babel/plugin-transform-unicode-escapes": "^7.25.7", + "@babel/plugin-transform-unicode-property-regex": "^7.25.7", + "@babel/plugin-transform-unicode-regex": "^7.25.7", + "@babel/plugin-transform-unicode-sets-regex": "^7.25.7", "@babel/preset-modules": "0.1.6-no-external-plugins", "babel-plugin-polyfill-corejs2": "^0.4.10", "babel-plugin-polyfill-corejs3": "^0.10.6", "babel-plugin-polyfill-regenerator": "^0.6.1", - "core-js-compat": "^3.37.1", + "core-js-compat": "^3.38.1", "semver": "^6.3.1" }, "engines": { @@ -1850,16 +1850,16 @@ } }, "node_modules/@babel/preset-typescript": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.24.7.tgz", - "integrity": "sha512-SyXRe3OdWwIwalxDg5UtJnJQO+YPcTfwiIY2B0Xlddh9o7jpWLvv8X1RthIeDOxQ+O1ML5BLPCONToObyVQVuQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.25.7.tgz", + "integrity": "sha512-rkkpaXJZOFN45Fb+Gki0c+KMIglk4+zZXOoMJuyEK8y8Kkc8Jd3BDmP7qPsz0zQMJj+UD7EprF+AqAXcILnexw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.7", - "@babel/helper-validator-option": "^7.24.7", - "@babel/plugin-syntax-jsx": "^7.24.7", - "@babel/plugin-transform-modules-commonjs": "^7.24.7", - "@babel/plugin-transform-typescript": "^7.24.7" + "@babel/helper-plugin-utils": "^7.25.7", + "@babel/helper-validator-option": "^7.25.7", + "@babel/plugin-syntax-jsx": "^7.25.7", + "@babel/plugin-transform-modules-commonjs": "^7.25.7", + "@babel/plugin-transform-typescript": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -1868,16 +1868,10 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/regjsgen": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz", - "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==", - "dev": true - }, "node_modules/@babel/runtime": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.6.tgz", - "integrity": "sha512-VBj9MYyDb9tuLq7yzqjgzt6Q+IBQLrGZfdjOekyEirZPHxXWoTSGUTMrpsfi58Up73d13NfYLv8HT9vmznjzhQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.7.tgz", + "integrity": "sha512-FjoyLe754PMiYsFaN5C94ttGiOmBNYTf6pLr4xXHAT5uctHb092PBszndLDR5XA/jghQvn4n7JMHl7dmTgbm9w==", "dev": true, "dependencies": { "regenerator-runtime": "^0.14.0" @@ -1887,30 +1881,30 @@ } }, "node_modules/@babel/template": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", - "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz", + "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/code-frame": "^7.25.7", + "@babel/parser": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.6.tgz", - "integrity": "sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz", + "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.25.6", - "@babel/parser": "^7.25.6", - "@babel/template": "^7.25.0", - "@babel/types": "^7.25.6", + "@babel/code-frame": "^7.25.7", + "@babel/generator": "^7.25.7", + "@babel/parser": "^7.25.7", + "@babel/template": "^7.25.7", + "@babel/types": "^7.25.7", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -1919,13 +1913,13 @@ } }, "node_modules/@babel/types": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", - "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.7.tgz", + "integrity": "sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", + "@babel/helper-string-parser": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -2475,50 +2469,6 @@ "deprecated": "Use @eslint/object-schema instead", "dev": true }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dev": true, - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", @@ -2858,16 +2808,6 @@ "url": "https://opencollective.com/parcel" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "dev": true, - "optional": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@pnpm/config.env-replace": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", @@ -2910,17 +2850,18 @@ } }, "node_modules/@rollup/plugin-commonjs": { - "version": "26.0.1", - "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-26.0.1.tgz", - "integrity": "sha512-UnsKoZK6/aGIH6AdkptXhNvhaqftcjq3zZdT+LY5Ftms6JR06nADcDsYp5hTU9E2lbJUEOhdlY5J4DNTneM+jQ==", + "version": "28.0.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.0.tgz", + "integrity": "sha512-BJcu+a+Mpq476DMXG+hevgPSl56bkUoi88dKT8t3RyUp8kGuOh+2bU8Gs7zXDlu+fyZggnJ+iOBGrb/O1SorYg==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", "commondir": "^1.0.1", "estree-walker": "^2.0.2", - "glob": "^10.4.1", + "fdir": "^6.1.1", "is-reference": "1.2.1", - "magic-string": "^0.30.3" + "magic-string": "^0.30.3", + "picomatch": "^2.3.1" }, "engines": { "node": ">=16.0.0 || 14 >= 14.17" @@ -2934,10 +2875,22 @@ } } }, + "node_modules/@rollup/plugin-commonjs/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/@rollup/plugin-dynamic-import-vars": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@rollup/plugin-dynamic-import-vars/-/plugin-dynamic-import-vars-2.1.2.tgz", - "integrity": "sha512-4lr2oXxs9hcxtGGaK8s0i9evfjzDrAs7ngw28TqruWKTEm0+U4Eljb+F6HXGYdFv8xRojQlrQwV7M/yxeh3yzQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-dynamic-import-vars/-/plugin-dynamic-import-vars-2.1.3.tgz", + "integrity": "sha512-9ZuItXkvbx0NUeEO0TMIYY7KAK/c7biumCTVrk6nwW81om7apA3/yju6JUm1pFMWmF/bZbyrom20NupRZWk9Wg==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -2979,15 +2932,14 @@ } }, "node_modules/@rollup/plugin-node-resolve": { - "version": "15.2.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.2.3.tgz", - "integrity": "sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==", + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.3.0.tgz", + "integrity": "sha512-9eO5McEICxMzJpDW9OnMYSv4Sta3hmt7VtBFz5zR9273suNOydOyq/FrGeGy+KsTRFm8w0SLVhzig2ILFT63Ag==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", "@types/resolve": "1.20.2", "deepmerge": "^4.2.2", - "is-builtin-module": "^3.2.1", "is-module": "^1.0.0", "resolve": "^1.22.1" }, @@ -3004,9 +2956,9 @@ } }, "node_modules/@rollup/plugin-replace": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-5.0.7.tgz", - "integrity": "sha512-PqxSfuorkHz/SPpyngLyg5GCEkOcee9M1bkxiVDr41Pd61mqP1PLOoDPbpl44SB2mQGKwV/In74gqQmGITOhEQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@rollup/plugin-replace/-/plugin-replace-6.0.1.tgz", + "integrity": "sha512-2sPh9b73dj5IxuMmDAsQWVFT7mR+yoHweBaXG2W/R8vQ+IWZlnaI7BR7J6EguVQUp1hd8Z7XuozpDjEKQAAC2Q==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.0.1", @@ -3025,9 +2977,9 @@ } }, "node_modules/@rollup/plugin-typescript": { - "version": "11.1.6", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.6.tgz", - "integrity": "sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.0.tgz", + "integrity": "sha512-Kzs8KGJofe7cfTRODsnG1jNGxSvU8gVoNNd7Z/QaY25AYwe2LSSUpx/kPxqF38NYkpR8de3m51r9uwJpDlz6dg==", "dev": true, "dependencies": { "@rollup/pluginutils": "^5.1.0", @@ -3051,9 +3003,9 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", - "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.2.tgz", + "integrity": "sha512-/FIdS3PyZ39bjZlwqFnWqCOVnW7o963LtKMwQOD0NhQqw22gSr2YY1afu3FxRip4ZCZNsD5jq6Aaz6QV3D/Njw==", "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", @@ -3071,10 +3023,21 @@ } } }, + "node_modules/@rollup/pluginutils/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.3.tgz", - "integrity": "sha512-MmKSfaB9GX+zXl6E8z4koOr/xU63AMVleLEa64v7R0QF/ZloMs5vcD1sHgM64GXXS1csaJutG+ddtzcueI/BLg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.0.tgz", + "integrity": "sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA==", "cpu": [ "arm" ], @@ -3085,9 +3048,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.3.tgz", - "integrity": "sha512-zrt8ecH07PE3sB4jPOggweBjJMzI1JG5xI2DIsUbkA+7K+Gkjys6eV7i9pOenNSDJH3eOr/jLb/PzqtmdwDq5g==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.0.tgz", + "integrity": "sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA==", "cpu": [ "arm64" ], @@ -3098,9 +3061,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.3.tgz", - "integrity": "sha512-P0UxIOrKNBFTQaXTxOH4RxuEBVCgEA5UTNV6Yz7z9QHnUJ7eLX9reOd/NYMO3+XZO2cco19mXTxDMXxit4R/eQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.0.tgz", + "integrity": "sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==", "cpu": [ "arm64" ], @@ -3111,9 +3074,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.3.tgz", - "integrity": "sha512-L1M0vKGO5ASKntqtsFEjTq/fD91vAqnzeaF6sfNAy55aD+Hi2pBI5DKwCO+UNDQHWsDViJLqshxOahXyLSh3EA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.0.tgz", + "integrity": "sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ==", "cpu": [ "x64" ], @@ -3124,9 +3087,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.3.tgz", - "integrity": "sha512-btVgIsCjuYFKUjopPoWiDqmoUXQDiW2A4C3Mtmp5vACm7/GnyuprqIDPNczeyR5W8rTXEbkmrJux7cJmD99D2g==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.0.tgz", + "integrity": "sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA==", "cpu": [ "arm" ], @@ -3137,9 +3100,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.3.tgz", - "integrity": "sha512-zmjbSphplZlau6ZTkxd3+NMtE4UKVy7U4aVFMmHcgO5CUbw17ZP6QCgyxhzGaU/wFFdTfiojjbLG3/0p9HhAqA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.0.tgz", + "integrity": "sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw==", "cpu": [ "arm" ], @@ -3150,9 +3113,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.3.tgz", - "integrity": "sha512-nSZfcZtAnQPRZmUkUQwZq2OjQciR6tEoJaZVFvLHsj0MF6QhNMg0fQ6mUOsiCUpTqxTx0/O6gX0V/nYc7LrgPw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.0.tgz", + "integrity": "sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA==", "cpu": [ "arm64" ], @@ -3163,9 +3126,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.3.tgz", - "integrity": "sha512-MnvSPGO8KJXIMGlQDYfvYS3IosFN2rKsvxRpPO2l2cum+Z3exiExLwVU+GExL96pn8IP+GdH8Tz70EpBhO0sIQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.0.tgz", + "integrity": "sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw==", "cpu": [ "arm64" ], @@ -3176,9 +3139,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.3.tgz", - "integrity": "sha512-+W+p/9QNDr2vE2AXU0qIy0qQE75E8RTwTwgqS2G5CRQ11vzq0tbnfBd6brWhS9bCRjAjepJe2fvvkvS3dno+iw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.0.tgz", + "integrity": "sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw==", "cpu": [ "ppc64" ], @@ -3189,9 +3152,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.3.tgz", - "integrity": "sha512-yXH6K6KfqGXaxHrtr+Uoy+JpNlUlI46BKVyonGiaD74ravdnF9BUNC+vV+SIuB96hUMGShhKV693rF9QDfO6nQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.0.tgz", + "integrity": "sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg==", "cpu": [ "riscv64" ], @@ -3202,9 +3165,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.3.tgz", - "integrity": "sha512-R8cwY9wcnApN/KDYWTH4gV/ypvy9yZUHlbJvfaiXSB48JO3KpwSpjOGqO4jnGkLDSk1hgjYkTbTt6Q7uvPf8eg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.0.tgz", + "integrity": "sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==", "cpu": [ "s390x" ], @@ -3215,9 +3178,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.3.tgz", - "integrity": "sha512-kZPbX/NOPh0vhS5sI+dR8L1bU2cSO9FgxwM8r7wHzGydzfSjLRCFAT87GR5U9scj2rhzN3JPYVC7NoBbl4FZ0g==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.0.tgz", + "integrity": "sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==", "cpu": [ "x64" ], @@ -3228,9 +3191,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.3.tgz", - "integrity": "sha512-S0Yq+xA1VEH66uiMNhijsWAafffydd2X5b77eLHfRmfLsRSpbiAWiRHV6DEpz6aOToPsgid7TI9rGd6zB1rhbg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.0.tgz", + "integrity": "sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==", "cpu": [ "x64" ], @@ -3241,9 +3204,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.3.tgz", - "integrity": "sha512-9isNzeL34yquCPyerog+IMCNxKR8XYmGd0tHSV+OVx0TmE0aJOo9uw4fZfUuk2qxobP5sug6vNdZR6u7Mw7Q+Q==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.0.tgz", + "integrity": "sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ==", "cpu": [ "arm64" ], @@ -3254,9 +3217,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.3.tgz", - "integrity": "sha512-nMIdKnfZfzn1Vsk+RuOvl43ONTZXoAPUUxgcU0tXooqg4YrAqzfKzVenqqk2g5efWh46/D28cKFrOzDSW28gTA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.0.tgz", + "integrity": "sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ==", "cpu": [ "ia32" ], @@ -3267,9 +3230,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.3.tgz", - "integrity": "sha512-fOvu7PCQjAj4eWDEuD8Xz5gpzFqXzGlxHZozHP4b9Jxv9APtdxL6STqztDzMLuRXEc4UpXGGhx029Xgm91QBeA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.0.tgz", + "integrity": "sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw==", "cpu": [ "x64" ], @@ -3514,9 +3477,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==" }, "node_modules/@types/fs-extra": { "version": "8.1.5", @@ -3599,9 +3562,9 @@ "dev": true }, "node_modules/@types/vscode": { - "version": "1.93.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.93.0.tgz", - "integrity": "sha512-kUK6jAHSR5zY8ps42xuW89NLcBpw1kOabah7yv38J8MyiYuOHxLQBi0e7zeXbQgVefDy/mZZetqEFC+Fl5eIEQ==", + "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 }, "node_modules/@types/vscode-semver": { @@ -3861,9 +3824,9 @@ "integrity": "sha512-bRRFxLfg5dtAyl5XyiVWz/ZBPahpOpPrNYnnHpOpUZvam4tKH35wdhP4Kj6PbM0+KdliOsPzbGWpkxcdpNB/sg==" }, "node_modules/@vscode/proxy-agent": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/@vscode/proxy-agent/-/proxy-agent-0.23.0.tgz", - "integrity": "sha512-6lgxRrzURdWwBkk6TaB0+EYYjIWQXxry6GlVO0toBN8amIyVd3I7hLPKU9Xf+SOrLIrbdU0CLkmTOBHpPJLf/g==", + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/@vscode/proxy-agent/-/proxy-agent-0.22.0.tgz", + "integrity": "sha512-TQrv456pbrjmD6G+iOoXE1Mflm+8Ic/Kny4QU7ioiYe2+0HisvqzJM/CUa3Am5SWrNjMbntTHISjgmSaSlorrA==", "dependencies": { "@tootallnate/once": "^3.0.0", "agent-base": "^7.0.1", @@ -4007,65 +3970,65 @@ } }, "node_modules/@xterm/addon-clipboard": { - "version": "0.2.0-beta.39", - "resolved": "https://registry.npmjs.org/@xterm/addon-clipboard/-/addon-clipboard-0.2.0-beta.39.tgz", - "integrity": "sha512-PeJZP69FHg2p1NJKLGyqUITahvEexqwYoQAgYheu4d9UBhIdP6D/KWGT8DVAEPeeulXhcr2UXgYWMVQAooTvrw==", + "version": "0.2.0-beta.49", + "resolved": "https://registry.npmjs.org/@xterm/addon-clipboard/-/addon-clipboard-0.2.0-beta.49.tgz", + "integrity": "sha512-rjYGvWOdv4chQ0J8r25iR1nAv9F2LGAy0VMUaz4jGAXPHC5JvLZdtN5Se+Hv6rNHGHS4FjiAZF2fJRY6YtQgAg==", "dependencies": { "js-base64": "^3.7.5" }, "peerDependencies": { - "@xterm/xterm": "^5.6.0-beta.56" + "@xterm/xterm": "^5.6.0-beta.66" } }, "node_modules/@xterm/addon-image": { - "version": "0.9.0-beta.56", - "resolved": "https://registry.npmjs.org/@xterm/addon-image/-/addon-image-0.9.0-beta.56.tgz", - "integrity": "sha512-kwE4ZDlPxXsBk4mnQoqMvSwu9aKQclniIybs90t0L2qGPLcI8/7Akm1i9aXbu8eZF2hoLEPfLC3CZPda+4ioOA==", + "version": "0.9.0-beta.66", + "resolved": "https://registry.npmjs.org/@xterm/addon-image/-/addon-image-0.9.0-beta.66.tgz", + "integrity": "sha512-BFpdJiIs3LnirhZwVAzadS9H/vgjhZEixCFxjY7B864hZZs6BrY4peFo2N33l59RHhuDd5pq6m9daTTd9k76/g==", "peerDependencies": { - "@xterm/xterm": "^5.6.0-beta.56" + "@xterm/xterm": "^5.6.0-beta.66" } }, "node_modules/@xterm/addon-search": { - "version": "0.16.0-beta.56", - "resolved": "https://registry.npmjs.org/@xterm/addon-search/-/addon-search-0.16.0-beta.56.tgz", - "integrity": "sha512-f8aoldPGssse1UR2N3f94fRUc7K3eulb+F80MFhim4rP+shX3QO9QdEZtwr+JaPEujjnuBM5tQKQDuRQtbwuMQ==", + "version": "0.16.0-beta.66", + "resolved": "https://registry.npmjs.org/@xterm/addon-search/-/addon-search-0.16.0-beta.66.tgz", + "integrity": "sha512-L1eDMOEa34/UGk+3arW6toDa3szz9afGqr51x9arnP5hqtDwEE5m9pYyBaDjO4OQy8I/gNqRT3BVwIZySrA88g==", "peerDependencies": { - "@xterm/xterm": "^5.6.0-beta.56" + "@xterm/xterm": "^5.6.0-beta.66" } }, "node_modules/@xterm/addon-serialize": { - "version": "0.14.0-beta.56", - "resolved": "https://registry.npmjs.org/@xterm/addon-serialize/-/addon-serialize-0.14.0-beta.56.tgz", - "integrity": "sha512-VGAYJXFfXuY1Ze8CliT28DoYI74s8fdTI9919C0sgWwtzfAa7W43jJ56g0oKVEM0wO20wfdESapwpQ7enMzrHQ==", + "version": "0.14.0-beta.66", + "resolved": "https://registry.npmjs.org/@xterm/addon-serialize/-/addon-serialize-0.14.0-beta.66.tgz", + "integrity": "sha512-t/hwjeosl0JljMR83hNY3BmwEj82AcMxXXWKzwa7B3C464EMY/UJS8VcJIJ1OMXzEHNMTrsRBOrI8PYbDDfETw==", "peerDependencies": { - "@xterm/xterm": "^5.6.0-beta.56" + "@xterm/xterm": "^5.6.0-beta.66" } }, "node_modules/@xterm/addon-unicode11": { - "version": "0.9.0-beta.56", - "resolved": "https://registry.npmjs.org/@xterm/addon-unicode11/-/addon-unicode11-0.9.0-beta.56.tgz", - "integrity": "sha512-oWa8xLWMDKgJboqOT57PaNAWYz+2INW5aUc24E0Nzv+gKXVy+8lRoqy50m3DhsOb1YtDaPVloqvambKBaXSing==", + "version": "0.9.0-beta.66", + "resolved": "https://registry.npmjs.org/@xterm/addon-unicode11/-/addon-unicode11-0.9.0-beta.66.tgz", + "integrity": "sha512-yaOw8kzW8lB40j5aU+vKN5kSm7UXOr6jXMWbCRDSn0yjk+3rXzihPZRH4jVDgdN2x1ASsiNvpBtnM443speOLw==", "peerDependencies": { - "@xterm/xterm": "^5.6.0-beta.56" + "@xterm/xterm": "^5.6.0-beta.66" } }, "node_modules/@xterm/addon-webgl": { - "version": "0.19.0-beta.56", - "resolved": "https://registry.npmjs.org/@xterm/addon-webgl/-/addon-webgl-0.19.0-beta.56.tgz", - "integrity": "sha512-aYNRENPJBb1uoV7QifEwCnbjCXmQD5yQmuxNJab3bOZ68aCSGC/EKc4/4Ov0klkXi8ceF4ZnbNiqAX3jw5L1jg==", + "version": "0.19.0-beta.66", + "resolved": "https://registry.npmjs.org/@xterm/addon-webgl/-/addon-webgl-0.19.0-beta.66.tgz", + "integrity": "sha512-HVLxYbZ5GbH6DSB7/gVfTraCXOLyO1YU1WOj7CuEvwaosZugb/TIm6AJWfWMMU72brVFg3qGuXlCzuldZTnboA==", "peerDependencies": { - "@xterm/xterm": "^5.6.0-beta.56" + "@xterm/xterm": "^5.6.0-beta.66" } }, "node_modules/@xterm/headless": { - "version": "5.6.0-beta.56", - "resolved": "https://registry.npmjs.org/@xterm/headless/-/headless-5.6.0-beta.56.tgz", - "integrity": "sha512-aQOCzFDn/yqdATwf+ho1q5Hu2MzQwnXHgcsVx/qwUit/URKgbp1QyOQom88nzprP6D/59tiSeX+tqUS1HPqwMw==" + "version": "5.6.0-beta.66", + "resolved": "https://registry.npmjs.org/@xterm/headless/-/headless-5.6.0-beta.66.tgz", + "integrity": "sha512-7d1fO6kdzcqjthZ1U+rVJiapJ/BuwoVv5qgvSE2ytzhjNAkLSWozqRKo+31ycwNLmP1a+QE4273IJ+wrHIBRng==" }, "node_modules/@xterm/xterm": { - "version": "5.6.0-beta.56", - "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.6.0-beta.56.tgz", - "integrity": "sha512-gtLrCQNkF1LikB21Bj9JYiBrrXMMvPEZkOIiA7MlXoSd7T7v+GYPumrODB2SBuhPdZ8N66z2rbUOfSRzxGwMtA==" + "version": "5.6.0-beta.66", + "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.6.0-beta.66.tgz", + "integrity": "sha512-hmvS0e4sa6xBmeKIwxZE+RDTKpeLqJ3VSOlMUzvi5utV3xa7gwt5M60eRlSn+0qi8cRMuUCTvJhDFW1pP62+lw==" }, "node_modules/@yarnpkg/lockfile": { "version": "1.1.0", @@ -4526,9 +4489,9 @@ } }, "node_modules/browserslist": { - "version": "4.23.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", - "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", + "integrity": "sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==", "dev": true, "funding": [ { @@ -4545,8 +4508,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001646", - "electron-to-chromium": "^1.5.4", + "caniuse-lite": "^1.0.30001663", + "electron-to-chromium": "^1.5.28", "node-releases": "^2.0.18", "update-browserslist-db": "^1.1.0" }, @@ -4588,18 +4551,6 @@ "node": "*" } }, - "node_modules/builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", @@ -4641,9 +4592,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001660", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001660.tgz", - "integrity": "sha512-GacvNTTuATm26qC74pt+ad1fW15mlQ/zuTzzY1ZoIzECTP8HURDfF43kNxPgf7H1jmelCBQTTbBNxdSXOA7Bqg==", + "version": "1.0.30001667", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001667.tgz", + "integrity": "sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw==", "dev": true, "funding": [ { @@ -5763,22 +5714,10 @@ "readable-stream": "^2.0.2" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "node_modules/electron-to-chromium": { - "version": "1.5.24", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.24.tgz", - "integrity": "sha512-0x0wLCmpdKFCi9ulhvYZebgcPmHTkFVUfU2wzDykadkslKwT4oAmDTHEKLnlrDsMGZe4B+ksn8quZfZjYsBetA==", - "dev": true - }, - "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "version": "1.5.32", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.32.tgz", + "integrity": "sha512-M+7ph0VGBQqqpTT2YrabjNKSQ2fEl9PVx6AK3N558gDH9NO8O6XN9SXXFWRo9u9PbEg/bWq+tjXQr+eXmxubCw==", "dev": true }, "node_modules/emojilib": { @@ -6801,6 +6740,20 @@ "pend": "~1.2.0" } }, + "node_modules/fdir": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.0.tgz", + "integrity": "sha512-3oB133prH1o4j/L5lLW7uOCF1PlD+/It2L0eL/iAqWMB91RBbqTewABqxhj0ibBd90EEmWZq7ntIWzVaWcXTGQ==", + "dev": true, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, "node_modules/figures": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/figures/-/figures-6.1.0.tgz", @@ -6936,22 +6889,6 @@ "is-callable": "^1.1.3" } }, - "node_modules/foreground-child": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", - "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/from2": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", @@ -7172,26 +7109,6 @@ "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==" }, - "node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dev": true, - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/glob-parent": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", @@ -7720,21 +7637,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-builtin-module": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", - "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", - "dev": true, - "dependencies": { - "builtin-modules": "^3.3.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -8088,21 +7990,6 @@ "node": "^18.17 || >=20.6.1" } }, - "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, "node_modules/java-properties": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz", @@ -8181,15 +8068,15 @@ } }, "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "dev": true, "bin": { "jsesc": "bin/jsesc" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/json-buffer": { @@ -8586,9 +8473,9 @@ "dev": true }, "node_modules/memfs": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.11.1.tgz", - "integrity": "sha512-LZcMTBAgqUUKNXZagcZxvXXfgF1bHX7Y7nQ0QyEiNbRJgE29GhgPd8Yna1VQcLlPiHt/5RFJMWYN9Uv/VPNvjQ==", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.12.0.tgz", + "integrity": "sha512-74wDsex5tQDSClVkeK1vtxqYCAgCoXxx+K4NSHzgU/muYVYByFqa+0RnrPO9NM6naWm1+G9JmZ0p6QHhXmeYfA==", "dependencies": { "@jsonjoy.com/json-pack": "^1.0.3", "@jsonjoy.com/util": "^1.3.0", @@ -8642,6 +8529,17 @@ "node": ">=8.6" } }, + "node_modules/micromatch/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/mime": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/mime/-/mime-4.0.4.tgz", @@ -8722,15 +8620,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "dev": true, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, "node_modules/mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -11797,12 +11686,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/package-json-from-dist": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", - "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", - "dev": true - }, "node_modules/param-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", @@ -12105,28 +11988,6 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "dev": true - }, "node_modules/path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -12157,11 +12018,14 @@ "dev": true }, "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "optional": true, + "peer": true, "engines": { - "node": ">=8.6" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/jonschlinkert" @@ -13088,15 +12952,15 @@ } }, "node_modules/regexpu-core": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-5.3.2.tgz", - "integrity": "sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-6.1.1.tgz", + "integrity": "sha512-k67Nb9jvwJcJmVpw0jPttR1/zVfnKf8Km0IPatrU/zJ5XeG3+Slx0xLXs9HByJSzXzrlz5EDvN6yLNMDc2qdnw==", "dev": true, "dependencies": { - "@babel/regjsgen": "^0.8.0", "regenerate": "^1.4.2", - "regenerate-unicode-properties": "^10.1.0", - "regjsparser": "^0.9.1", + "regenerate-unicode-properties": "^10.2.0", + "regjsgen": "^0.8.0", + "regjsparser": "^0.11.0", "unicode-match-property-ecmascript": "^2.0.0", "unicode-match-property-value-ecmascript": "^2.1.0" }, @@ -13131,27 +12995,24 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/regjsgen": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.8.0.tgz", + "integrity": "sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==", + "dev": true + }, "node_modules/regjsparser": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.9.1.tgz", - "integrity": "sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.11.1.tgz", + "integrity": "sha512-1DHODs4B8p/mQHU9kr+jv8+wIC9mtG4eBHxWxIq5mhjE3D5oORhCc6deRKzTjs9DcfRFmj9BHSDguZklqCGFWQ==", "dev": true, "dependencies": { - "jsesc": "~0.5.0" + "jsesc": "~3.0.2" }, "bin": { "regjsparser": "bin/parser" } }, - "node_modules/regjsparser/node_modules/jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", - "dev": true, - "bin": { - "jsesc": "bin/jsesc" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -13275,12 +13136,12 @@ } }, "node_modules/rollup": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.3.tgz", - "integrity": "sha512-7sqRtBNnEbcBtMeRVc6VRsJMmpI+JU1z9VTvW8D4gXIYQFz0aLcsE6rRkyghZkLfEgUZgVvOG7A5CVz/VW5GIA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.0.tgz", + "integrity": "sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==", "devOptional": true, "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -13290,22 +13151,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.21.3", - "@rollup/rollup-android-arm64": "4.21.3", - "@rollup/rollup-darwin-arm64": "4.21.3", - "@rollup/rollup-darwin-x64": "4.21.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.21.3", - "@rollup/rollup-linux-arm-musleabihf": "4.21.3", - "@rollup/rollup-linux-arm64-gnu": "4.21.3", - "@rollup/rollup-linux-arm64-musl": "4.21.3", - "@rollup/rollup-linux-powerpc64le-gnu": "4.21.3", - "@rollup/rollup-linux-riscv64-gnu": "4.21.3", - "@rollup/rollup-linux-s390x-gnu": "4.21.3", - "@rollup/rollup-linux-x64-gnu": "4.21.3", - "@rollup/rollup-linux-x64-musl": "4.21.3", - "@rollup/rollup-win32-arm64-msvc": "4.21.3", - "@rollup/rollup-win32-ia32-msvc": "4.21.3", - "@rollup/rollup-win32-x64-msvc": "4.21.3", + "@rollup/rollup-android-arm-eabi": "4.24.0", + "@rollup/rollup-android-arm64": "4.24.0", + "@rollup/rollup-darwin-arm64": "4.24.0", + "@rollup/rollup-darwin-x64": "4.24.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.24.0", + "@rollup/rollup-linux-arm-musleabihf": "4.24.0", + "@rollup/rollup-linux-arm64-gnu": "4.24.0", + "@rollup/rollup-linux-arm64-musl": "4.24.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.24.0", + "@rollup/rollup-linux-riscv64-gnu": "4.24.0", + "@rollup/rollup-linux-s390x-gnu": "4.24.0", + "@rollup/rollup-linux-x64-gnu": "4.24.0", + "@rollup/rollup-linux-x64-musl": "4.24.0", + "@rollup/rollup-win32-arm64-msvc": "4.24.0", + "@rollup/rollup-win32-ia32-msvc": "4.24.0", + "@rollup/rollup-win32-x64-msvc": "4.24.0", "fsevents": "~2.3.2" } }, @@ -13525,6 +13386,18 @@ "node": ">=12" } }, + "node_modules/rollup-plugin-styles/node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/rollup-plugin-styles/node_modules/yaml": { "version": "1.10.2", "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", @@ -14285,71 +14158,6 @@ "safe-buffer": "~5.1.0" } }, - "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dev": true, - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/string.prototype.trim": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", @@ -14411,19 +14219,6 @@ "node": ">=8" } }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -15315,133 +15110,6 @@ "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", "dev": true }, - "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/wrap-ansi-cjs/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -15584,9 +15252,9 @@ } }, "node_modules/zx": { - "version": "8.1.7", - "resolved": "https://registry.npmjs.org/zx/-/zx-8.1.7.tgz", - "integrity": "sha512-vPXetXOnlJ6a6bGSCIN1iaxjK2QZbOqwyOfMhFzqUpKF1aHPGQvQXu8ijwDQMe4lUMyk1Mo0qpIhrNzYXES6nw==", + "version": "8.1.9", + "resolved": "https://registry.npmjs.org/zx/-/zx-8.1.9.tgz", + "integrity": "sha512-UHuLHphHmsBYKkAchkSrEN4nzDyagafqC9HUxtc1J7eopaScW6H9dsLJ1lmkAntnLtDTGoM8fa+jrJrXiIfKFA==", "dev": true, "bin": { "zx": "build/cli.js" diff --git a/package.json b/package.json index f1ca60c9..62d5aab6 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,9 @@ }, "config": { "vscode": { - "version": "1.93.1", - "ref": "1.93.1", - "commit": "38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40" + "version": "1.94.0", + "ref": "1.94.0", + "commit": "d78a74bcdfad14d5d3b1b782f87255d802b57511" }, "monaco": { "ref": "v0.52.0", @@ -41,26 +41,26 @@ } }, "devDependencies": { - "@babel/core": "^7.25.2", + "@babel/core": "^7.25.7", "@babel/plugin-proposal-class-properties": "^7.18.6", - "@babel/plugin-proposal-decorators": "^7.24.7", - "@babel/preset-env": "^7.25.4", - "@babel/preset-typescript": "^7.24.7", + "@babel/plugin-proposal-decorators": "^7.25.7", + "@babel/preset-env": "^7.25.7", + "@babel/preset-typescript": "^7.25.7", "@codingame/commitlint-config-codingame": "^1.1.1", "@codingame/eslint-config": "^1.2.1", "@codingame/semantic-release-config-github": "^1.0.0", "@codingame/tsconfig": "^1.1.1", "@commitlint/cli": "^19.5.0", - "@rollup/plugin-commonjs": "^26.0.1", - "@rollup/plugin-dynamic-import-vars": "^2.1.2", + "@rollup/plugin-commonjs": "^28.0.0", + "@rollup/plugin-dynamic-import-vars": "^2.1.3", "@rollup/plugin-json": "^6.1.0", - "@rollup/plugin-node-resolve": "^15.2.3", - "@rollup/plugin-replace": "^5.0.7", - "@rollup/plugin-typescript": "^11.1.6", + "@rollup/plugin-node-resolve": "^15.3.0", + "@rollup/plugin-replace": "^6.0.1", + "@rollup/plugin-typescript": "^12.1.0", "@types/mime-types": "^2.1.4", "@types/node": "18.19.8", "@types/semver": "^7.5.8", - "@types/vscode": "~1.93.0", + "@types/vscode": "~1.94.0", "@types/vscode-semver": "npm:@types/semver@=5.5.0", "@types/yargs": "^17.0.33", "@types/yauzl": "^2.10.3", @@ -82,7 +82,7 @@ "pascal-case": "^3.1.2", "patch-package": "^8.0.0", "recast": "^0.23.9", - "rollup": "^4.21.3", + "rollup": "^4.24.0", "rollup-plugin-copy": "^3.5.0", "rollup-plugin-dts": "^6.1.1", "rollup-plugin-styles": "^4.0.0", @@ -94,35 +94,36 @@ "typescript": "^5.6.2", "vscode-semver": "npm:semver@=5.5.0", "yargs": "^17.7.2", - "zx": "^8.1.6" + "zx": "^8.1.9" }, "dependencies": { "@microsoft/1ds-core-js": "^3.2.13", "@microsoft/1ds-post-js": "^3.2.13", "@parcel/watcher": "2.1.0", - "@rollup/pluginutils": "^5.1.0", + "@rollup/pluginutils": "^5.1.2", "@vscode/iconv-lite-umd": "0.7.0", - "@vscode/proxy-agent": "^0.23.0", + "@vscode/proxy-agent": "^0.22.0", "@vscode/ripgrep": "^1.15.9", "@vscode/spdlog": "^0.15.0", + "@vscode/tree-sitter-wasm": "^0.0.4", "@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.39", - "@xterm/addon-image": "0.9.0-beta.56", - "@xterm/addon-search": "0.16.0-beta.56", - "@xterm/addon-serialize": "0.14.0-beta.56", - "@xterm/addon-unicode11": "0.9.0-beta.56", - "@xterm/addon-webgl": "0.19.0-beta.56", - "@xterm/headless": "5.6.0-beta.56", - "@xterm/xterm": "5.6.0-beta.56", + "@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", "css-url-parser": "^1.1.4", "jschardet": "3.1.3", "kerberos": "2.1.1", "keytar": "^7.9.0", "marked": "~14.0.0", - "memfs": "^4.11.1", + "memfs": "^4.12.0", "mime-types": "^2.1.35", "node-pty": "1.1.0-beta21", "vscode-oniguruma": "1.7.0", diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index 733d82fc..82f44d97 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -324,6 +324,9 @@ function transformVSCodeCode (id: string, code: string) { } function resolveVscode (importee: string, importer?: string) { + if (importee.endsWith('.js')) { + importee = importee.slice(0, -3) + } if (importer != null && importee.startsWith('.')) { importee = nodePath.resolve(nodePath.dirname(importer), importee) } diff --git a/src/extension.api.ts b/src/extension.api.ts index 45115feb..6fe35830 100644 --- a/src/extension.api.ts +++ b/src/extension.api.ts @@ -315,7 +315,8 @@ const api: typeof vscode = { InlineEditTriggerKind: extHostTypes.InlineEditTriggerKind, ExcludeSettingOptions: searchExtTypes.ExcludeSettingOptions, TextSearchContextNew: searchExtTypes.TextSearchContextNew, - TextSearchMatchNew: searchExtTypes.TextSearchMatchNew + TextSearchMatchNew: searchExtTypes.TextSearchMatchNew, + ChatResponseCodeblockUriPart: extHostTypes.ChatResponseCodeblockUriPart } // @ts-ignore the syntax will be transformed by a typescript transformer in the rollup config diff --git a/src/missing-services.ts b/src/missing-services.ts index 3bb3e948..69b6fba9 100644 --- a/src/missing-services.ts +++ b/src/missing-services.ts @@ -226,6 +226,11 @@ import { IIntegrityService } from 'vs/workbench/services/integrity/common/integr import { IntegrityTestResult } from 'vs/workbench/services/integrity/common/integrity' import { ITrustedDomainService } from 'vs/workbench/contrib/url/browser/trustedDomainService.service' import { ILanguageModelToolsService } from 'vs/workbench/contrib/chat/common/languageModelToolsService.service' +import { PortsEnablement } from 'vs/workbench/services/remote/common/remoteExplorerService' +import { ICodeMapperService } from 'vs/workbench/contrib/chat/common/chatCodeMapperService.service' +import { IChatEditingService } from 'vs/workbench/contrib/chat/common/chatEditingService.service' +import { IActionViewItemService } from 'vs/platform/actions/browser/actionViewItemService.service' +import { ITreeSitterTokenizationFeature } from 'vs/workbench/services/treeSitter/browser/treeSitterTokenizationFeature.service' import { getBuiltInExtensionTranslationsUris, getExtensionIdProvidingCurrentLocale } from './l10n' import { unsupported } from './tools' @@ -969,9 +974,10 @@ registerSingleton(IExtensionHostDebugService, class ExtensionHostDebugService im }, InstantiationType.Eager) registerSingleton(IViewsService, class ViewsService implements IViewsService { + _serviceBrand: undefined + isViewContainerActive = () => false getFocusedViewName = unsupported onDidChangeFocusedView = Event.None - _serviceBrand: undefined onDidChangeViewContainerVisibility = Event.None isViewContainerVisible = () => false openViewContainer = unsupported @@ -1106,6 +1112,7 @@ registerSingleton(ICustomEndpointTelemetryService, NullEndpointTelemetryService, class MonacoSearchService implements ISearchService { _serviceBrand: undefined constructor (@IModelService private modelService: IModelService) {} + getAIName = async () => undefined aiTextSearch = unsupported textSearchSplitSyncAsync = unsupported @@ -1166,6 +1173,11 @@ registerSingleton(ITimerService, class TimerService implements ITimerService { registerSingleton(IExtensionsWorkbenchService, class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { _serviceBrand: undefined + updateAutoUpdateForAllExtensions = unsupported + openSearch = unsupported + getExtensionRuntimeStatus = () => undefined + onDidChangeExtensionsNotification = Event.None + getExtensionsNotification = () => undefined shouldRequireConsentToUpdate = async () => undefined updateAutoUpdateValue = unsupported getResourceExtensions = unsupported @@ -2315,6 +2327,9 @@ registerSingleton(IAccessibleViewInformationService, class AccessibleViewInforma registerSingleton(IWorkbenchExtensionManagementService, class WorkbenchExtensionManagementService implements IWorkbenchExtensionManagementService { _serviceBrand: undefined + onProfileAwareDidInstallExtensions = Event.None + onProfileAwareDidUninstallExtension = Event.None + onProfileAwareDidUpdateExtensionMetadata = Event.None uninstallExtensions = unsupported resetPinnedStateForAllUserExtensions = unsupported getInstalledWorkspaceExtensionLocations = () => [] @@ -2435,6 +2450,7 @@ registerSingleton(IExtensionUrlHandler, class ExtensionUrlHandler implements IEx registerSingleton(ICommentService, class CommentService implements ICommentService { _serviceBrand: undefined + lastActiveCommentcontroller = undefined get commentsModel () { return unsupported() @@ -2605,7 +2621,7 @@ registerSingleton(IRemoteExplorerService, class RemoteExplorerService implements restore = unsupported enablePortsFeatures = unsupported onEnabledPortsFeatures = Event.None - portsFeaturesEnabled = false + portsFeaturesEnabled = PortsEnablement.Disabled namedProcesses = new Map() }, InstantiationType.Delayed) @@ -2640,6 +2656,10 @@ registerSingleton(IAuthenticationAccessService, class AuthenticationAccessServic registerSingleton(IAuthenticationExtensionsService, class AuthenticationExtensionsService implements IAuthenticationExtensionsService { _serviceBrand: undefined + onDidChangeAccountPreference = Event.None + getAccountPreference = () => undefined + updateAccountPreference = unsupported + removeAccountPreference = unsupported updateSessionPreference = unsupported getSessionPreference = () => undefined removeSessionPreference = unsupported @@ -2650,6 +2670,8 @@ registerSingleton(IAuthenticationExtensionsService, class AuthenticationExtensio registerSingleton(IAuthenticationUsageService, class AuthenticationUsageService implements IAuthenticationUsageService { _serviceBrand: undefined + initializeExtensionUsageCache = unsupported + extensionUsesAuth = async () => false readAccountUsages = unsupported removeAccountUsage = unsupported addAccountUsage = unsupported @@ -2744,6 +2766,10 @@ registerSingleton(IWorkbenchIssueService, class WorkbenchIssueService implements registerSingleton(ISCMViewService, class SCMViewService implements ISCMViewService { _serviceBrand: undefined + get activeRepository () { + return unsupported() + } + get menus () { return unsupported() } @@ -3200,6 +3226,7 @@ registerSingleton(IUserDataSyncUtilService, class UserDataSyncUtilService implem registerSingleton(IUserDataProfileManagementService, class UserDataProfileManagementService implements IUserDataProfileManagementService { _serviceBrand: undefined + getDefaultProfileToUse = unsupported createProfile = unsupported createAndEnterProfile = unsupported createAndEnterTransientProfile = unsupported @@ -3371,3 +3398,27 @@ registerSingleton(IIssueFormService, class IssueFormService implements IIssueFor sendReporterMenu = unsupported closeReporter = unsupported }, InstantiationType.Delayed) + +registerSingleton(ICodeMapperService, class CodeMapperService implements ICodeMapperService { + _serviceBrand: undefined + registerCodeMapperProvider = unsupported + mapCode = async () => undefined +}, InstantiationType.Delayed) + +registerSingleton(IChatEditingService, class ChatEditingService implements IChatEditingService { + _serviceBrand: undefined + onDidCreateEditingSession = Event.None + currentEditingSession = null + startOrContinueEditingSession = unsupported +}, InstantiationType.Delayed) + +registerSingleton(IActionViewItemService, class ActionViewItemService implements IActionViewItemService { + _serviceBrand: undefined + onDidChange = Event.None + register = unsupported + lookUp = () => undefined +}, InstantiationType.Delayed) + +registerSingleton(ITreeSitterTokenizationFeature, class TreeSitterTokenizationFeature implements ITreeSitterTokenizationFeature { + _serviceBrand: undefined +}, InstantiationType.Delayed) diff --git a/src/service-override/chat.ts b/src/service-override/chat.ts index 3ad67577..1ab7cd9e 100644 --- a/src/service-override/chat.ts +++ b/src/service-override/chat.ts @@ -27,7 +27,10 @@ import 'vs/workbench/contrib/chat/browser/chat.contribution' import 'vs/workbench/contrib/inlineChat/browser/inlineChat.contribution' import { ILanguageModelToolsService } from 'vs/workbench/contrib/chat/common/languageModelToolsService.service' import { LanguageModelToolsService } from 'vs/workbench/contrib/chat/common/languageModelToolsService' - +import { ICodeMapperService } from 'vs/workbench/contrib/chat/common/chatCodeMapperService.service' +import { CodeMapperService } from 'vs/workbench/contrib/chat/common/chatCodeMapperService' +import { IChatEditingService } from 'vs/workbench/contrib/chat/common/chatEditingService.service' +import { ChatEditingService } from 'vs/workbench/contrib/chat/browser/chatEditingService' export default function getServiceOverride (): IEditorOverrideServices { return { [IChatService.toString()]: new SyncDescriptor(ChatService, [], true), @@ -44,6 +47,8 @@ export default function getServiceOverride (): IEditorOverrideServices { [IChatCodeBlockContextProviderService.toString()]: new SyncDescriptor(ChatCodeBlockContextProviderService, [], true), [ILanguageModelStatsService.toString()]: new SyncDescriptor(LanguageModelStatsService, [], true), [IChatAgentNameService.toString()]: new SyncDescriptor(ChatAgentNameService, [], true), - [ILanguageModelToolsService.toString()]: new SyncDescriptor(LanguageModelToolsService, [], true) + [ILanguageModelToolsService.toString()]: new SyncDescriptor(LanguageModelToolsService, [], true), + [ICodeMapperService.toString()]: new SyncDescriptor(CodeMapperService, [], true), + [IChatEditingService.toString()]: new SyncDescriptor(ChatEditingService, [], true) } } diff --git a/src/service-override/viewCommon.ts b/src/service-override/viewCommon.ts index 81c5ab12..993ded89 100644 --- a/src/service-override/viewCommon.ts +++ b/src/service-override/viewCommon.ts @@ -38,6 +38,8 @@ import { IEditorPaneService } from 'vs/workbench/services/editor/common/editorPa import { EditorPaneService } from 'vs/workbench/services/editor/browser/editorPaneService' import { CustomEditorLabelService } from 'vs/workbench/services/editor/common/customEditorLabelService' import { ICustomEditorLabelService } from 'vs/workbench/services/editor/common/customEditorLabelService.service' +import { ActionViewItemService } from 'vs/platform/actions/browser/actionViewItemService' +import { IActionViewItemService } from 'vs/platform/actions/browser/actionViewItemService.service' import getBulkEditServiceOverride from './bulkEdit' import { changeUrlDomain } from './tools/url' import { registerAssets } from '../assets' @@ -101,7 +103,8 @@ function getServiceOverride (_webviewIframeAlternateDomains?: string): IEditorOv [IProgressService.toString()]: new SyncDescriptor(ProgressService, [], true), [IAuxiliaryWindowService.toString()]: new SyncDescriptor(BrowserAuxiliaryWindowService, [], true), [IEditorPaneService.toString()]: new SyncDescriptor(EditorPaneService, [], true), - [ICustomEditorLabelService.toString()]: new SyncDescriptor(CustomEditorLabelService, [], true) + [ICustomEditorLabelService.toString()]: new SyncDescriptor(CustomEditorLabelService, [], true), + [IActionViewItemService.toString()]: new SyncDescriptor(ActionViewItemService, [], true) } } diff --git a/vscode-paches/0001-fix-allow-importing-vscode-oniguruma.patch b/vscode-paches/0001-fix-allow-importing-vscode-oniguruma.patch index a2632582..e1d36806 100644 --- a/vscode-paches/0001-fix-allow-importing-vscode-oniguruma.patch +++ b/vscode-paches/0001-fix-allow-importing-vscode-oniguruma.patch @@ -8,10 +8,10 @@ Subject: [PATCH] fix: allow importing vscode-oniguruma 1 file changed, 1 insertion(+) diff --git a/.eslintrc.json b/.eslintrc.json -index 1deaf02985b..889ddcd4d3d 100644 +index 879d547f9b5..6282847cafb 100644 --- a/.eslintrc.json +++ b/.eslintrc.json -@@ -673,6 +673,7 @@ +@@ -731,6 +731,7 @@ "v8-inspect-profiler", "vscode-regexpp", "vscode-textmate", diff --git a/vscode-paches/0002-fix-fix-editor-api-types.patch b/vscode-paches/0002-fix-fix-editor-api-types.patch index a384a50a..01f54aec 100644 --- a/vscode-paches/0002-fix-fix-editor-api-types.patch +++ b/vscode-paches/0002-fix-fix-editor-api-types.patch @@ -8,10 +8,10 @@ Subject: [PATCH] fix: fix editor api types 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js -index 088748b8356..324514d04b5 100644 +index 0d55982a8aa..debdf037393 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js -@@ -277,7 +277,16 @@ function toExternalDTS(contents) { +@@ -239,7 +239,16 @@ function toExternalDTS(contents) { } if (line.indexOf('declare let MonacoEnvironment') === 0) { diff --git a/vscode-paches/0004-cleanup-remove-amd-build-to-speed-up-editor-build.patch b/vscode-paches/0003-cleanup-remove-amd-build-to-speed-up-editor-build.patch similarity index 75% rename from vscode-paches/0004-cleanup-remove-amd-build-to-speed-up-editor-build.patch rename to vscode-paches/0003-cleanup-remove-amd-build-to-speed-up-editor-build.patch index 34d1524a..87dc1cae 100644 --- a/vscode-paches/0004-cleanup-remove-amd-build-to-speed-up-editor-build.patch +++ b/vscode-paches/0003-cleanup-remove-amd-build-to-speed-up-editor-build.patch @@ -4,14 +4,14 @@ Date: Mon, 11 Mar 2024 16:44:07 +0100 Subject: [PATCH] cleanup: remove amd build to speed up editor build --- - build/gulpfile.editor.js | 15 ++++----------- - 1 file changed, 4 insertions(+), 11 deletions(-) + 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 324514d04b5..0cc0fd8b806 100644 +index debdf037393..a5951d21d34 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js -@@ -413,17 +413,10 @@ gulp.task('editor-distro', +@@ -375,16 +375,9 @@ gulp.task('editor-distro', util.rimraf('out-editor-min') ), extractEditorSrcTask, @@ -24,12 +24,10 @@ index 324514d04b5..0cc0fd8b806 100644 - task.series( - createESMSourcesAndResourcesTask, - compileEditorESMTask, -- appendJSToESMImportsTask - ) + task.series( + createESMSourcesAndResourcesTask, + compileEditorESMTask, -+ appendJSToESMImportsTask ), finalEditorResourcesTask ) diff --git a/vscode-paches/0003-fix-fix-some-build-process-edge-cases.patch b/vscode-paches/0003-fix-fix-some-build-process-edge-cases.patch deleted file mode 100644 index b058973d..00000000 --- a/vscode-paches/0003-fix-fix-some-build-process-edge-cases.patch +++ /dev/null @@ -1,60 +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:42:35 +0100 -Subject: [PATCH] fix: fix some build process edge cases - ---- - build/lib/standalone.js | 7 +++++++ - build/lib/standalone.ts | 7 +++++++ - 2 files changed, 14 insertions(+) - -diff --git a/build/lib/standalone.js b/build/lib/standalone.js -index 78030842569..2e2b716dcb7 100644 ---- a/build/lib/standalone.js -+++ b/build/lib/standalone.js -@@ -147,6 +147,9 @@ function createESMSourcesAndResources2(options) { - const info = ts.preProcessFile(fileContents); - for (let i = info.importedFiles.length - 1; i >= 0; i--) { - const importedFilename = info.importedFiles[i].fileName; -+ if (!importedFilename.startsWith('vs/')) { -+ continue; -+ } - const pos = info.importedFiles[i].pos; - const end = info.importedFiles[i].end; - let importedFilepath; -@@ -169,6 +172,10 @@ function createESMSourcesAndResources2(options) { - else { - relativePath = path.relative(path.dirname(file), importedFilepath); - } -+ if (relativePath.endsWith('..')) { -+ // When a folder have the same name as a file -+ relativePath = relativePath + '/../' + path.basename(importedFilepath); -+ } - relativePath = relativePath.replace(/\\/g, '/'); - if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) { - relativePath = './' + relativePath; -diff --git a/build/lib/standalone.ts b/build/lib/standalone.ts -index e1b9db65e12..b5f94e7836a 100644 ---- a/build/lib/standalone.ts -+++ b/build/lib/standalone.ts -@@ -177,6 +177,9 @@ export function createESMSourcesAndResources2(options: IOptions2): void { - - for (let i = info.importedFiles.length - 1; i >= 0; i--) { - const importedFilename = info.importedFiles[i].fileName; -+ if (!importedFilename.startsWith('vs/')) { -+ continue; -+ } - const pos = info.importedFiles[i].pos; - const end = info.importedFiles[i].end; - -@@ -198,6 +201,10 @@ export function createESMSourcesAndResources2(options: IOptions2): void { - } else { - relativePath = path.relative(path.dirname(file), importedFilepath); - } -+ if (relativePath.endsWith('..')) { -+ // When a folder have the same name as a file -+ relativePath = relativePath + '/../' + path.basename(importedFilepath); -+ } - relativePath = relativePath.replace(/\\/g, '/'); - if (!/(^\.\/)|(^\.\.\/)/.test(relativePath)) { - relativePath = './' + relativePath; diff --git a/vscode-paches/0005-feat-output-es2022.patch b/vscode-paches/0004-feat-output-es2022.patch similarity index 65% rename from vscode-paches/0005-feat-output-es2022.patch rename to vscode-paches/0004-feat-output-es2022.patch index ccfc9bc6..25e74c66 100644 --- a/vscode-paches/0005-feat-output-es2022.patch +++ b/vscode-paches/0004-feat-output-es2022.patch @@ -4,28 +4,26 @@ Date: Mon, 11 Mar 2024 16:44:35 +0100 Subject: [PATCH] feat: output es2022 --- - src/tsconfig.base.json | 3 ++- + src/tsconfig.base.json | 2 +- src/tsconfig.monaco.json | 4 ++-- - 2 files changed, 4 insertions(+), 3 deletions(-) + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tsconfig.base.json b/src/tsconfig.base.json -index c0a2e174591..1d80c22afa3 100644 +index 9c7aacd4f11..9f6858a7801 100644 --- a/src/tsconfig.base.json +++ b/src/tsconfig.base.json -@@ -1,6 +1,7 @@ - { - "compilerOptions": { -- "module": "amd", -+ "esModuleInterop": true, -+ "module": "ES2020", - "moduleResolution": "node", - "experimentalDecorators": true, - "noImplicitReturns": true, +@@ -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 bb4fd1ccc35..702c492934b 100644 +index 1e138cf9085..a2a07d7b7d3 100644 --- a/src/tsconfig.monaco.json +++ b/src/tsconfig.monaco.json -@@ -7,8 +7,8 @@ +@@ -8,8 +8,8 @@ "wicg-file-system-access" ], "paths": {}, diff --git a/vscode-paches/0006-fix-markdown-do-not-encode-i10l-location.patch b/vscode-paches/0005-fix-markdown-do-not-encode-i10l-location.patch similarity index 100% rename from vscode-paches/0006-fix-markdown-do-not-encode-i10l-location.patch rename to vscode-paches/0005-fix-markdown-do-not-encode-i10l-location.patch diff --git a/vscode-paches/0007-fix-typescript-handle-trailing-slash.patch b/vscode-paches/0006-fix-typescript-handle-trailing-slash.patch similarity index 100% rename from vscode-paches/0007-fix-typescript-handle-trailing-slash.patch rename to vscode-paches/0006-fix-typescript-handle-trailing-slash.patch diff --git a/vscode-paches/0008-fix-typescript-missing-default-value.patch b/vscode-paches/0007-fix-typescript-missing-default-value.patch similarity index 100% rename from vscode-paches/0008-fix-typescript-missing-default-value.patch rename to vscode-paches/0007-fix-typescript-missing-default-value.patch diff --git a/vscode-paches/0009-fix-typescript-handle-missing-case.patch b/vscode-paches/0008-fix-typescript-handle-missing-case.patch similarity index 100% rename from vscode-paches/0009-fix-typescript-handle-missing-case.patch rename to vscode-paches/0008-fix-typescript-handle-missing-case.patch diff --git a/vscode-paches/0010-feat-add-static-asset-url-mechanism.patch b/vscode-paches/0009-feat-add-static-asset-url-mechanism.patch similarity index 92% rename from vscode-paches/0010-feat-add-static-asset-url-mechanism.patch rename to vscode-paches/0009-feat-add-static-asset-url-mechanism.patch index 6f1a43d0..db8c4d2e 100644 --- a/vscode-paches/0010-feat-add-static-asset-url-mechanism.patch +++ b/vscode-paches/0009-feat-add-static-asset-url-mechanism.patch @@ -12,18 +12,18 @@ Subject: [PATCH] feat: add static asset url mechanism 5 files changed, 208 insertions(+), 69 deletions(-) diff --git a/src/vs/base/common/network.ts b/src/vs/base/common/network.ts -index 99fabfb377f..e043e8e458d 100644 +index 7f141568abf..9eeda8b4633 100644 --- a/src/vs/base/common/network.ts +++ b/src/vs/base/common/network.ts -@@ -4,6 +4,8 @@ - *--------------------------------------------------------------------------------------------*/ +@@ -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 { - import * as errors from 'vs/base/common/errors'; -+import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -+import { ResourceMap } from 'vs/base/common/map'; - import * as platform from 'vs/base/common/platform'; - import { equalsIgnoreCase, startsWithIgnoreCase } from 'vs/base/common/strings'; - import { URI } from 'vs/base/common/uri'; @@ -248,6 +250,20 @@ export const VSCODE_AUTHORITY = 'vscode-app'; class FileAccessImpl { @@ -50,10 +50,10 @@ index 99fabfb377f..e043e8e458d 100644 */ asBrowserUri(resourcePath: AppResourcePath | ''): URI { - // ESM-comment-begin -- const uri = this.toUri(resourcePath, require); +- // const uri = this.toUri(resourcePath, require); - // ESM-comment-end - // ESM-uncomment-begin -- // const uri = this.toUri(resourcePath); +- const uri = this.toUri(resourcePath); - // ESM-uncomment-end + const uri = this.toUri(resourcePath, { toUrl: this.toUrl.bind(this) }); return this.uriToBrowserUri(uri); @@ -73,10 +73,10 @@ index 99fabfb377f..e043e8e458d 100644 */ asFileUri(resourcePath: AppResourcePath | ''): URI { - // ESM-comment-begin -- const uri = this.toUri(resourcePath, require); +- // const uri = this.toUri(resourcePath, require); - // ESM-comment-end - // ESM-uncomment-begin -- // const uri = this.toUri(resourcePath); +- const uri = this.toUri(resourcePath); - // ESM-uncomment-end + const uri = this.toUri(resourcePath, { toUrl: this.toUrl.bind(this) }); return this.uriToFileUri(uri); @@ -103,7 +103,7 @@ index 99fabfb377f..e043e8e458d 100644 export const FileAccess = new FileAccessImpl(); diff --git a/src/vs/workbench/api/browser/mainThreadExtensionService.ts b/src/vs/workbench/api/browser/mainThreadExtensionService.ts -index 7c4db0a5def..298e14f9b28 100644 +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 @@ -121,10 +121,10 @@ index 7c4db0a5def..298e14f9b28 100644 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 6732f0ce931..d4ecabb0c26 100644 +index 4900f545fb4..15dc855752a 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts -@@ -1487,6 +1487,7 @@ export interface MainThreadExtensionServiceShape extends IDisposable { +@@ -1525,6 +1525,7 @@ export interface MainThreadExtensionServiceShape extends IDisposable { $onExtensionRuntimeError(extensionId: ExtensionIdentifier, error: SerializedError): void; $setPerformanceMarks(marks: performance.PerformanceMark[]): Promise; $asBrowserUri(uri: UriComponents): Promise; @@ -133,7 +133,7 @@ index 6732f0ce931..d4ecabb0c26 100644 export interface SCMProviderFeatures { diff --git a/src/vs/workbench/api/common/extensionHostMain.ts b/src/vs/workbench/api/common/extensionHostMain.ts -index 50c47ba98a8..2aa00be8fe4 100644 +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 { @@ -149,15 +149,15 @@ index 50c47ba98a8..2aa00be8fe4 100644 this._extensionService.terminate(reason); } diff --git a/src/vs/workbench/api/worker/extensionHostWorker.ts b/src/vs/workbench/api/worker/extensionHostWorker.ts -index b98117318b7..9ba12208ff9 100644 +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 'vs/base/common/performance'; +@@ -15,7 +15,6 @@ import * as performance from '../../../base/common/performance.js'; - import 'vs/workbench/api/common/extHost.common.services'; - import 'vs/workbench/api/worker/extHost.worker.services'; --import { FileAccess } from 'vs/base/common/network'; - import { URI } from 'vs/base/common/uri'; + 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 { diff --git a/vscode-paches/0011-fix-remove-ttf-url-search-parameter-breaking-import.patch b/vscode-paches/0010-fix-remove-ttf-url-search-parameter-breaking-import.patch similarity index 100% rename from vscode-paches/0011-fix-remove-ttf-url-search-parameter-breaking-import.patch rename to vscode-paches/0010-fix-remove-ttf-url-search-parameter-breaking-import.patch diff --git a/vscode-paches/0012-fix-apply-style-only-on-standalone-editors.patch b/vscode-paches/0011-fix-apply-style-only-on-standalone-editors.patch similarity index 94% rename from vscode-paches/0012-fix-apply-style-only-on-standalone-editors.patch rename to vscode-paches/0011-fix-apply-style-only-on-standalone-editors.patch index 5fc9b7c6..d9efeeb6 100644 --- a/vscode-paches/0012-fix-apply-style-only-on-standalone-editors.patch +++ b/vscode-paches/0011-fix-apply-style-only-on-standalone-editors.patch @@ -15,7 +15,7 @@ Subject: [PATCH] fix: apply style only on standalone editors 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 4de800bd521..de9b4b9143c 100644 +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 @@ -80,10 +80,10 @@ index 4de800bd521..de9b4b9143c 100644 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 660e00eea1c..8c999f39c86 100644 +index 59f027dd434..91703a85ce8 100644 --- a/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts +++ b/src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts -@@ -270,6 +270,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE +@@ -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), @@ -91,7 +91,7 @@ index 660e00eea1c..8c999f39c86 100644 options, accessibilityService)); this._register(this._configuration.onDidChange((e) => { this._onDidChangeConfiguration.fire(e); -@@ -378,8 +379,8 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE +@@ -381,8 +382,8 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE this._modelData?.view.writeScreenReaderContent(reason); } @@ -102,7 +102,7 @@ index 660e00eea1c..8c999f39c86 100644 } public getId(): string { -@@ -1955,6 +1956,12 @@ export interface ICodeEditorWidgetOptions { +@@ -1959,6 +1960,12 @@ export interface ICodeEditorWidgetOptions { */ isSimpleWidget?: boolean; @@ -116,10 +116,10 @@ index 660e00eea1c..8c999f39c86 100644 * 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 e22b0291dd0..097167b755a 100644 +index da2e28f1c44..41d9152f1e6 100644 --- a/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts -@@ -52,6 +52,12 @@ import { DiffEditorViewModel, DiffMapping, DiffState } from './diffEditorViewMod +@@ -51,6 +51,12 @@ import { CSSStyle, ObservableElementSizeObserver, RefCounted, applyStyle, applyV export interface IDiffCodeEditorWidgetOptions { originalEditor?: ICodeEditorWidgetOptions; modifiedEditor?: ICodeEditorWidgetOptions; @@ -132,7 +132,7 @@ index e22b0291dd0..097167b755a 100644 } export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor { -@@ -111,6 +117,8 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor { +@@ -110,6 +116,8 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor { this._contextKeyService.createKey('isInDiffEditor', true); @@ -195,7 +195,7 @@ index 1fc85078f9e..c74aca00541 100644 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 3ccfa128dc2..9ee85e6804a 100644 +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 @@ -217,10 +217,10 @@ index 3ccfa128dc2..9ee85e6804a 100644 instantiationService, codeEditorService, diff --git a/src/vs/editor/test/browser/config/testConfiguration.ts b/src/vs/editor/test/browser/config/testConfiguration.ts -index 4a2e87e6d48..d96690e36ee 100644 +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 'vs/platform/actions/common/actions'; +@@ -14,7 +14,7 @@ import { MenuId } from '../../../../platform/actions/common/actions.js'; export class TestConfiguration extends EditorConfiguration { constructor(opts: Readonly) { @@ -230,7 +230,7 @@ index 4a2e87e6d48..d96690e36ee 100644 protected override _readEnvConfiguration(): IEnvConfiguration { diff --git a/src/vs/editor/test/browser/testCodeEditor.ts b/src/vs/editor/test/browser/testCodeEditor.ts -index 5a79e483795..3f5d2e03cd8 100644 +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 { @@ -243,10 +243,10 @@ index 5a79e483795..3f5d2e03cd8 100644 } 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 1a2621a00c4..be7f7c085d9 100644 +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 -@@ -504,7 +504,7 @@ export class NotebookMultiCursorController extends Disposable implements INotebo +@@ -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); diff --git a/vscode-paches/0013-fix-use-existing-method.patch b/vscode-paches/0012-fix-use-existing-method.patch similarity index 97% rename from vscode-paches/0013-fix-use-existing-method.patch rename to vscode-paches/0012-fix-use-existing-method.patch index ed7d291d..eb6c298c 100644 --- a/vscode-paches/0013-fix-use-existing-method.patch +++ b/vscode-paches/0012-fix-use-existing-method.patch @@ -8,7 +8,7 @@ Subject: [PATCH] fix: use existing method 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 e4f06ac453f..3b9815e86ec 100644 +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 { diff --git a/vscode-paches/0014-refactor-split-code.patch b/vscode-paches/0013-refactor-split-code.patch similarity index 97% rename from vscode-paches/0014-refactor-split-code.patch rename to vscode-paches/0013-refactor-split-code.patch index 9a1f6a15..017eb348 100644 --- a/vscode-paches/0014-refactor-split-code.patch +++ b/vscode-paches/0013-refactor-split-code.patch @@ -9,7 +9,7 @@ Subject: [PATCH] refactor: split code 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 3b9815e86ec..c763e7ccd83 100644 +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 { @@ -35,7 +35,7 @@ index 3b9815e86ec..c763e7ccd83 100644 } return this._cachedResolver; diff --git a/src/vs/workbench/services/keybinding/browser/keybindingService.ts b/src/vs/workbench/services/keybinding/browser/keybindingService.ts -index 76b3fa79a5c..3c98bf9aec0 100644 +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 { diff --git a/vscode-paches/0015-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch b/vscode-paches/0014-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch similarity index 64% rename from vscode-paches/0015-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch rename to vscode-paches/0014-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch index 66380dfc..015babb5 100644 --- a/vscode-paches/0015-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch +++ b/vscode-paches/0014-cleanup-remove-code-already-done-in-EditorFeaturesIn.patch @@ -9,18 +9,18 @@ Subject: [PATCH] cleanup: remove code already done in 1 file changed, 12 deletions(-) diff --git a/src/vs/editor/standalone/browser/standaloneServices.ts b/src/vs/editor/standalone/browser/standaloneServices.ts -index c763e7ccd83..85b999bf4de 100644 +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 'vs/editor/common/services/languageFeatures'; - import { ILanguageConfigurationService } from 'vs/editor/common/languages/languageConfigurationRegistry'; - import { LogService } from 'vs/platform/log/common/logService'; --import { getEditorFeatures } from 'vs/editor/common/editorFeatures'; --import { onUnexpectedError } from 'vs/base/common/errors'; - import { ExtensionKind, IEnvironmentService, IExtensionHostDebugParams } from 'vs/platform/environment/common/environment'; - import { mainWindow } from 'vs/base/browser/window'; - import { ResourceMap } from 'vs/base/common/map'; + 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 { } } diff --git a/vscode-paches/0016-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch b/vscode-paches/0015-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch similarity index 59% rename from vscode-paches/0016-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch rename to vscode-paches/0015-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch index 47b1a8d7..53cfcaec 100644 --- a/vscode-paches/0016-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch +++ b/vscode-paches/0015-fix-replace-amd-imports-by-regular-esm-dynamic-impor.patch @@ -10,18 +10,18 @@ Subject: [PATCH] fix: replace amd imports by regular esm dynamic imports .../contrib/terminal/browser/terminalInstance.ts | 3 +-- .../terminal/browser/xterm/xtermTerminal.ts | 13 ++++++------- .../browser/terminalStickyScrollOverlay.ts | 5 ++--- - .../textMateWorkerTokenizerController.ts | 4 +--- - .../worker/textMateTokenizationWorker.worker.ts | 12 +++++------- - .../worker/textMateWorkerTokenizer.ts | 4 +--- - .../browser/textMateTokenizationFeatureImpl.ts | 15 ++++++++------- + .../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, 32 insertions(+), 66 deletions(-) + 11 files changed, 24 insertions(+), 56 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json -index 889ddcd4d3d..05e59fcf47a 100644 +index 6282847cafb..795a5b934e8 100644 --- a/.eslintrc.json +++ b/.eslintrc.json -@@ -296,14 +296,6 @@ +@@ -301,14 +301,6 @@ "jsdoc/require-returns": "warn" } }, @@ -36,24 +36,24 @@ index 889ddcd4d3d..05e59fcf47a 100644 { "files": [ "src/**/{browser,electron-sandbox}/**/*.ts" -@@ -863,6 +855,7 @@ +@@ -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 { - "when": "hasBrowser", diff --git a/src/vs/platform/assignment/common/assignmentService.ts b/src/vs/platform/assignment/common/assignmentService.ts -index c573b727e0b..8c52126a590 100644 +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 'vs/platform/configuration/common/configur - import { IProductService } from 'vs/platform/product/common/productService'; - import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils'; - import { AssignmentFilterProvider, ASSIGNMENT_REFETCH_INTERVAL, ASSIGNMENT_STORAGE_KEY, IAssignmentService, TargetPopulation } from 'vs/platform/assignment/common/assignment'; --import { importAMDNodeModule } from 'vs/amdX'; - import { IEnvironmentService } from 'vs/platform/environment/common/environment'; +@@ -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 { @@ -66,18 +66,18 @@ index c573b727e0b..8c52126a590 100644 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 6585e563ba0..a4729fabe2e 100644 +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 'vs/amdX'; - import { onUnexpectedError } from 'vs/base/common/errors'; - import { mixin } from 'vs/base/common/objects'; --import { isWeb } from 'vs/base/common/platform'; - import { ITelemetryAppender, validateTelemetryData } from 'vs/platform/telemetry/common/telemetryUtils'; +-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'; @@ -85,15 +85,15 @@ index 6585e563ba0..a4729fabe2e 100644 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'); +- // 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'); +- // 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'); @@ -102,18 +102,18 @@ index 6585e563ba0..a4729fabe2e 100644 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 ff8607f6019..896f61d9359 100644 +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 'vs/workbench/services/history/common/history'; - import { isHorizontal, IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; - import { IPathService } from 'vs/workbench/services/path/common/pathService'; - import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; --import { importAMDNodeModule } from 'vs/amdX'; +@@ -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 'vs/workbench/contrib/accessibility/common/accessibilityCommands'; - import { terminalStrings } from 'vs/workbench/contrib/terminal/common/terminalStrings'; -@@ -727,7 +726,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance { + 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) => { @@ -123,18 +123,18 @@ index ff8607f6019..896f61d9359 100644 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 3f96c847469..5ba1425a49a 100644 +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 'vs/workbench/contrib/terminal/browser/xterm/dec - import { ITerminalCapabilityStore, ITerminalCommand, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; - import { Emitter } from 'vs/base/common/event'; - import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; --import { importAMDNodeModule } from 'vs/amdX'; - import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; - import { TerminalContextKeys } from 'vs/workbench/contrib/terminal/common/terminalContextKey'; - import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -@@ -744,42 +743,42 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach +@@ -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) { @@ -184,17 +184,17 @@ index 3f96c847469..5ba1425a49a 100644 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 92d0aeb48c4..d8ec5418112 100644 +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 'vs/amdX'; - import { $, addDisposableListener, addStandardDisposableListener, getWindow } from 'vs/base/browser/dom'; - import { memoize, throttle } from 'vs/base/common/decorators'; - import { Event } from 'vs/base/common/event'; +-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 @@ -211,190 +211,113 @@ index 92d0aeb48c4..d8ec5418112 100644 } diff --git a/src/vs/workbench/services/textMate/browser/backgroundTokenization/textMateWorkerTokenizerController.ts b/src/vs/workbench/services/textMate/browser/backgroundTokenization/textMateWorkerTokenizerController.ts -index 419a1320def..0f68e115b90 100644 +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 'vs/amdX'; - import { Disposable } from 'vs/base/common/lifecycle'; - import { IObservable, autorun, keepObserved } from 'vs/base/common/observable'; - import { Proxied } from 'vs/base/common/worker/simpleWorker'; -@@ -19,7 +18,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur - import { observableConfigValue } from 'vs/platform/observable/common/platformObservableUtils'; - import { ArrayEdit, MonotonousIndexTransformer, SingleArrayEdit } from 'vs/workbench/services/textMate/browser/arrayOperation'; - import type { StateDeltas, TextMateTokenizationWorker } from 'vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker'; --import type { applyStateStackDiff, StateStack } from 'vscode-textmate'; -+import { StateStack, applyStateStackDiff, INITIAL } from 'vscode-textmate'; - - export class TextMateWorkerTokenizerController extends Disposable { - private static _id = 0; -@@ -180,7 +179,6 @@ export class TextMateWorkerTokenizerController extends Disposable { +-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 237f681f3bc..7ba45d41153 100644 +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 -@@ -8,11 +8,11 @@ import { LanguageId } from 'vs/editor/common/encodedTokenAttributes'; - import { IModelChangedEvent } from 'vs/editor/common/model/mirrorTextModel'; - import { ICreateGrammarResult, TMGrammarFactory } from 'vs/workbench/services/textMate/common/TMGrammarFactory'; - import { IValidEmbeddedLanguagesMap, IValidGrammarDefinition, IValidTokenTypeMap } from 'vs/workbench/services/textMate/common/TMScopeRegistry'; --import type { IOnigLib, IRawTheme, StackDiff } from 'vscode-textmate'; - import { TextMateWorkerTokenizer } from './textMateWorkerTokenizer'; --import { importAMDNodeModule } from 'vs/amdX'; - import { IRequestHandler, IWorkerServer } from 'vs/base/common/worker/simpleWorker'; - import { TextMateWorkerHost } from './textMateWorkerHost'; -+import * as vscodeTextmate from 'vscode-textmate'; -+import * as vscodeOniguruma from 'vscode-oniguruma'; - - /** - * Defines the worker entry point. Must be exported and named `create`. -@@ -42,7 +42,7 @@ export interface IValidGrammarDefinitionDTO { - export interface StateDeltas { - startLineNumber: number; - // null means the state for that line did not change -- stateDeltas: (StackDiff | null)[]; -+ stateDeltas: (vscodeTextmate.StackDiff | null)[]; - } - - export class TextMateTokenizationWorker implements IRequestHandler { -@@ -75,8 +75,6 @@ export class TextMateTokenizationWorker implements IRequestHandler { +@@ -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'. -@@ -85,7 +83,7 @@ export class TextMateTokenizationWorker implements IRequestHandler { - const bytes = await response.arrayBuffer(); - await vscodeOniguruma.loadWASM(bytes); - -- const onigLib: Promise = Promise.resolve({ -+ const onigLib: Promise = Promise.resolve({ - createOnigScanner: (sources) => vscodeOniguruma.createOnigScanner(sources), - createOnigString: (str) => vscodeOniguruma.createOnigString(str) - }); -@@ -142,7 +140,7 @@ export class TextMateTokenizationWorker implements IRequestHandler { - } - } - -- public async $acceptTheme(theme: IRawTheme, colorMap: string[]): Promise { -+ public async $acceptTheme(theme: vscodeTextmate.IRawTheme, colorMap: string[]): Promise { - const grammarFactory = await this._grammarFactory; - grammarFactory?.setTheme(theme, colorMap); - } 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 112d76ec0d9..99b09749431 100644 +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 'vs/amdX'; - import { RunOnceScheduler } from 'vs/base/common/async'; - import { observableValue } from 'vs/base/common/observable'; - import { setTimeout0 } from 'vs/base/common/platform'; -@@ -16,7 +15,7 @@ import { ContiguousMultilineTokensBuilder } from 'vs/editor/common/tokens/contig - import { LineTokens } from 'vs/editor/common/tokens/lineTokens'; - import { TextMateTokenizationSupport } from 'vs/workbench/services/textMate/browser/tokenizationSupport/textMateTokenizationSupport'; - import { TokenizationSupportWithLineLimit } from 'vs/workbench/services/textMate/browser/tokenizationSupport/tokenizationSupportWithLineLimit'; --import type { StackDiff, StateStack, diffStateStacksRefEq } from 'vscode-textmate'; -+import { StackDiff, StateStack, diffStateStacksRefEq } from 'vscode-textmate'; - import { ICreateGrammarResult } from 'vs/workbench/services/textMate/common/TMGrammarFactory'; - import { StateDeltas } from 'vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker'; - import { Disposable } from 'vs/base/common/lifecycle'; -@@ -115,7 +114,6 @@ export class TextMateWorkerTokenizer extends MirrorTextModel { +-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 734d72a998b..0daa52bbded 100644 +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 'vs/amdX'; -+import { resolveAmdNodeModulePath } from 'vs/amdX'; - import { canASAR, isESM } from 'vs/base/common/amd'; - import * as dom from 'vs/base/browser/dom'; - import { equals as equalArray } from 'vs/base/common/arrays'; -@@ -38,7 +38,8 @@ import { TMGrammarFactory, missingTMGrammarErrorMessage } from 'vs/workbench/ser - import { ITMSyntaxExtensionPoint, grammarsExtPoint } from 'vs/workbench/services/textMate/common/TMGrammars'; - import { IValidEmbeddedLanguagesMap, IValidGrammarDefinition, IValidTokenTypeMap } from 'vs/workbench/services/textMate/common/TMScopeRegistry'; - import { ITextMateThemingRule, IWorkbenchColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; --import type { IGrammar, IOnigLib, IRawTheme } from 'vscode-textmate'; -+import * as vscodeTextmate from 'vscode-textmate'; -+import * as vscodeOniguruma from 'vscode-oniguruma'; - - export class TextMateTokenizationFeature extends Disposable implements ITextMateTokenizationService { - private static reportTokenizationTimeCounter = { sync: 0, async: 0 }; -@@ -54,7 +55,7 @@ export class TextMateTokenizationFeature extends Disposable implements ITextMate - private _grammarDefinitions: IValidGrammarDefinition[] | null = null; - private _grammarFactory: TMGrammarFactory | null = null; - private readonly _tokenizersRegistrations = new DisposableStore(); -- private _currentTheme: IRawTheme | null = null; -+ private _currentTheme: vscodeTextmate.IRawTheme | null = null; - private _currentTokenColorMap: string[] | null = null; - private readonly _threadedBackgroundTokenizerFactory = this._instantiationService.createInstance( - ThreadedBackgroundTokenizerFactory, -@@ -246,8 +247,8 @@ export class TextMateTokenizationFeature extends Disposable implements ITextMate +-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 onigLib: Promise = Promise.resolve({ -+ const vscodeOniguruma = await this._getVSCodeOniguruma(); -+ const onigLib: Promise = Promise.resolve({ ++ 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) - }); -@@ -340,7 +341,7 @@ export class TextMateTokenizationFeature extends Disposable implements ITextMate - } - } - -- public async createTokenizer(languageId: string): Promise { -+ public async createTokenizer(languageId: string): Promise { - if (!this._languageService.isRegisteredLanguageId(languageId)) { - return null; - } -@@ -357,7 +358,7 @@ export class TextMateTokenizationFeature extends Disposable implements ITextMate +@@ -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 wasm = await 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 537ec42d3dc..6be61851b33 100644 +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 'vs/base/common/stream'; - import { VSBuffer, VSBufferReadable, VSBufferReadableStream } from 'vs/base/common/buffer'; --import { importAMDNodeModule } from 'vs/amdX'; - import { CancellationTokenSource } from 'vs/base/common/cancellation'; - import { coalesce } from 'vs/base/common/arrays'; --import { isESM } from 'vs/base/common/amd'; + 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'; diff --git a/vscode-paches/0017-feat-export-some-classes-and-make-some-methods-acces.patch b/vscode-paches/0016-feat-export-some-classes-and-make-some-methods-acces.patch similarity index 87% rename from vscode-paches/0017-feat-export-some-classes-and-make-some-methods-acces.patch rename to vscode-paches/0016-feat-export-some-classes-and-make-some-methods-acces.patch index 05ed647c..f7c1cd3c 100644 --- a/vscode-paches/0017-feat-export-some-classes-and-make-some-methods-acces.patch +++ b/vscode-paches/0016-feat-export-some-classes-and-make-some-methods-acces.patch @@ -4,6 +4,7 @@ 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 +- .../workbench/api/browser/statusBarExtensionPoint.ts | 2 +- src/vs/workbench/browser/layout.ts | 10 +++++----- @@ -29,15 +30,28 @@ Subject: [PATCH] feat: export some classes and make some methods accessible .../terminal/common/embedderTerminalService.ts | 2 +- .../userDataProfile/common/remoteUserDataProfiles.ts | 2 +- .../services/userDataSync/common/userDataSyncUtil.ts | 2 +- - 25 files changed, 43 insertions(+), 43 deletions(-) + 26 files changed, 44 insertions(+), 44 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 fdefc170db0..1d3bc4affc5 100644 +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 'vs/platform/log/common/log'; - import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; - import { AbstractExtensionResourceLoaderService, IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader'; +@@ -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 { @@ -45,7 +59,7 @@ index fdefc170db0..1d3bc4affc5 100644 declare readonly _serviceBrand: undefined; diff --git a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts b/src/vs/workbench/api/browser/statusBarExtensionPoint.ts -index 99dd3279fe8..b692381eaa2 100644 +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 { @@ -58,10 +72,10 @@ index 99dd3279fe8..b692381eaa2 100644 declare readonly _serviceBrand: undefined; diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts -index 4ca393d98c3..2753d08f437 100644 +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 'vs/base/browser/window'; +@@ -51,7 +51,7 @@ import { CodeWindow, mainWindow } from '../../base/browser/window.js'; //#region Layout Implementation @@ -100,7 +114,7 @@ index 4ca393d98c3..2753d08f437 100644 readonly filesToDiff?: IPathToOpen[]; readonly filesToMerge?: IPathToOpen[]; diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts -index 7c11f502ea5..5211f730099 100644 +index f081430e49f..46172e06143 100644 --- a/src/vs/workbench/browser/workbench.ts +++ b/src/vs/workbench/browser/workbench.ts @@ -82,7 +82,7 @@ export class Workbench extends Layout { @@ -158,12 +172,12 @@ index 7c11f502ea5..5211f730099 100644 // 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 08449bd2cd7..f82ac191725 100644 +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 'vs/workbench/services/envir - import { IHostService } from 'vs/workbench/services/host/browser/host'; - import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService'; +@@ -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 { @@ -171,12 +185,12 @@ index 08449bd2cd7..f82ac191725 100644 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 f9f3104f8b3..8d3eb0c0e4e 100644 +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 'vs/base/common/uri'; - import { RemoteNameContext } from 'vs/workbench/common/contextkeys'; - import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys'; +@@ -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'); @@ -196,7 +210,7 @@ index f9f3104f8b3..8d3eb0c0e4e 100644 readonly _serviceBrand: undefined; diff --git a/src/vs/workbench/contrib/logs/common/defaultLogLevels.ts b/src/vs/workbench/contrib/logs/common/defaultLogLevels.ts -index 522b64a8cd6..b43c170bf2e 100644 +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 { @@ -209,7 +223,7 @@ index 522b64a8cd6..b43c170bf2e 100644 _serviceBrand: undefined; diff --git a/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.ts b/src/vs/workbench/services/dialogs/browser/abstractFileDialogService.ts -index c6a2df09c76..88399f0d728 100644 +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 { @@ -222,10 +236,10 @@ index c6a2df09c76..88399f0d728 100644 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 de6a4ad8227..2b0ac26789f 100644 +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 'vs/editor/browser/widget/codeEditor/em +@@ -24,7 +24,7 @@ import { EmbeddedCodeEditorWidget } from '../../../../editor/browser/widget/code export class FileDialogService extends AbstractFileDialogService implements IFileDialogService { @memoize @@ -244,7 +258,7 @@ index de6a4ad8227..2b0ac26789f 100644 } } diff --git a/src/vs/workbench/services/extensionManagement/browser/extensionBisect.ts b/src/vs/workbench/services/extensionManagement/browser/extensionBisect.ts -index d339e68cfe8..201e6372cde 100644 +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 { @@ -257,7 +271,7 @@ index d339e68cfe8..201e6372cde 100644 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 0e60b30cd13..a8fef74dbc4 100644 +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 { @@ -270,7 +284,7 @@ index 0e60b30cd13..a8fef74dbc4 100644 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 82347b71978..83bce6798aa 100644 +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 @@ -301,7 +315,7 @@ index 82347b71978..83bce6798aa 100644 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 696f8227e6e..48c0e3bc2d4 100644 +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 = { @@ -314,7 +328,7 @@ index 696f8227e6e..48c0e3bc2d4 100644 readonly _serviceBrand: undefined; diff --git a/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts b/src/vs/workbench/services/extensions/browser/webWorkerExtensionHost.ts -index 543e8cd2206..0c2e68dd1ec 100644 +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 @@ -327,7 +341,7 @@ index 543e8cd2206..0c2e68dd1ec 100644 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 df1b2733947..dace2286a1c 100644 +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 @@ -352,7 +366,7 @@ index df1b2733947..dace2286a1c 100644 this._deltaExtensionsQueue.push(item); if (this._inHandleDeltaExtensions) { // Let the current item finish, the new one will be picked up -@@ -1285,7 +1285,7 @@ export interface IExtensionHostFactory { +@@ -1289,7 +1289,7 @@ export interface IExtensionHostFactory { createExtensionHost(runningLocations: ExtensionRunningLocationTracker, runningLocation: ExtensionRunningLocation, isInitialStart: boolean): IExtensionHost | null; } @@ -362,7 +376,7 @@ index df1b2733947..dace2286a1c 100644 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 3c98bf9aec0..3ab26183771 100644 +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 { @@ -375,7 +389,7 @@ index 3c98bf9aec0..3ab26183771 100644 this._onDidUpdateKeybindings.fire(); } diff --git a/src/vs/workbench/services/languageStatus/common/languageStatusService.ts b/src/vs/workbench/services/languageStatus/common/languageStatusService.ts -index e10d2a3ef1e..6dd88102a64 100644 +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 { @@ -388,10 +402,10 @@ index e10d2a3ef1e..6dd88102a64 100644 declare _serviceBrand: undefined; diff --git a/src/vs/workbench/services/localization/browser/localeService.ts b/src/vs/workbench/services/localization/browser/localeService.ts -index 07616fa0a2e..c77edccfe58 100644 +index 554ecb2bce9..63082ed6952 100644 --- a/src/vs/workbench/services/localization/browser/localeService.ts +++ b/src/vs/workbench/services/localization/browser/localeService.ts -@@ -132,7 +132,7 @@ export class WebLocaleService implements ILocaleService { +@@ -109,7 +109,7 @@ export class WebLocaleService implements ILocaleService { } } @@ -401,12 +415,12 @@ index 07616fa0a2e..c77edccfe58 100644 constructor( diff --git a/src/vs/workbench/services/outline/browser/outlineService.ts b/src/vs/workbench/services/outline/browser/outlineService.ts -index f4707432371..7c5cdde39cc 100644 +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 'vs/workbench/common/editor'; - import { IOutline, IOutlineCreator, IOutlineService, OutlineTarget } from 'vs/workbench/services/outline/browser/outline'; - import { Event, Emitter } from 'vs/base/common/event'; +@@ -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 { @@ -414,10 +428,10 @@ index f4707432371..7c5cdde39cc 100644 declare _serviceBrand: undefined; diff --git a/src/vs/workbench/services/path/browser/pathService.ts b/src/vs/workbench/services/path/browser/pathService.ts -index 664884d60ba..2457dbaa576 100644 +index ac35093bc65..12cedea8f20 100644 --- a/src/vs/workbench/services/path/browser/pathService.ts +++ b/src/vs/workbench/services/path/browser/pathService.ts -@@ -28,7 +28,7 @@ export class BrowserPathService extends AbstractPathService { +@@ -27,7 +27,7 @@ export class BrowserPathService extends AbstractPathService { } } @@ -427,10 +441,10 @@ index 664884d60ba..2457dbaa576 100644 // 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 be889244846..875a9072cf0 100644 +index cbf78719a20..2b6fb4c4f05 100644 --- a/src/vs/workbench/services/remote/common/remoteExplorerService.ts +++ b/src/vs/workbench/services/remote/common/remoteExplorerService.ts -@@ -139,7 +139,7 @@ export interface IRemoteExplorerService { +@@ -145,7 +145,7 @@ export interface IRemoteExplorerService { readonly namedProcesses: Map; } @@ -440,12 +454,12 @@ index be889244846..875a9072cf0 100644 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 ce9954eb03d..477eceb0abd 100644 +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 'vs/workbench/services/localization/c - import { IWorkbenchExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; - import { Mutable } from 'vs/base/common/types'; +@@ -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 { @@ -453,7 +467,7 @@ index ce9954eb03d..477eceb0abd 100644 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 5e322af7a0f..07b4abdd636 100644 +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 { @@ -466,7 +480,7 @@ index 5e322af7a0f..07b4abdd636 100644 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 d3ef612836b..0d0fb8d2862 100644 +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 { @@ -479,12 +493,12 @@ index d3ef612836b..0d0fb8d2862 100644 readonly _serviceBrand: undefined; diff --git a/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.ts b/src/vs/workbench/services/userDataSync/common/userDataSyncUtil.ts -index cd7f253b913..cf07954716e 100644 +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 'vs/base/common/uri'; - import { ITextModelService } from 'vs/editor/common/services/resolverService'; - import { ITextResourcePropertiesService, ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration'; +@@ -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 { diff --git a/vscode-paches/0018-fix-improve-extension-contribution-types.patch b/vscode-paches/0017-fix-improve-extension-contribution-types.patch similarity index 99% rename from vscode-paches/0018-fix-improve-extension-contribution-types.patch rename to vscode-paches/0017-fix-improve-extension-contribution-types.patch index 227ddd57..9f8e1a76 100644 --- a/vscode-paches/0018-fix-improve-extension-contribution-types.patch +++ b/vscode-paches/0017-fix-improve-extension-contribution-types.patch @@ -11,17 +11,17 @@ Subject: [PATCH] fix: improve extension contribution types 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 822260bdc2f..43dac321e5b 100644 +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 'vs/base/common/jsonSchema'; - import Severity from 'vs/base/common/severity'; - import * as strings from 'vs/base/common/strings'; - import { URI } from 'vs/base/common/uri'; ++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'; @@ -1627,10 +1627,10 @@ index 822260bdc2f..43dac321e5b 100644 export interface IExtensionCapabilities { diff --git a/src/vs/workbench/services/search/common/queryBuilder.ts b/src/vs/workbench/services/search/common/queryBuilder.ts -index 53b37e5f17d..1360c0dcf76 100644 +index 4b712c6be50..2d68500db7a 100644 --- a/src/vs/workbench/services/search/common/queryBuilder.ts +++ b/src/vs/workbench/services/search/common/queryBuilder.ts -@@ -604,10 +604,10 @@ export class QueryBuilder { +@@ -613,10 +613,10 @@ export class QueryBuilder { folderName: includeFolderName ? folderName : undefined, excludePattern: excludePatternRet, fileEncoding: folderConfig.files && folderConfig.files.encoding, @@ -1646,7 +1646,7 @@ index 53b37e5f17d..1360c0dcf76 100644 } } diff --git a/src/vs/workbench/services/themes/common/colorExtensionPoint.ts b/src/vs/workbench/services/themes/common/colorExtensionPoint.ts -index 9a7bf4aa503..235e0ed2948 100644 +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 @@ -1659,7 +1659,7 @@ index 9a7bf4aa503..235e0ed2948 100644 }); diff --git a/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts b/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.ts -index 80f5ee077cb..49abd845677 100644 +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 { diff --git a/src/vs/workbench/api/worker/extHostExtensionService.ts b/src/vs/workbench/api/worker/extHostExtensionService.ts -index b83a462131d..5ce2ec7413b 100644 +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 'vs/platform/extensions/common/extensions' - import { ExtensionRuntime } from 'vs/workbench/api/common/extHostTypes'; - import { timeout } from 'vs/base/common/async'; - import { ExtHostConsoleForwarder } from 'vs/workbench/api/worker/extHostConsoleForwarder'; -+import { isWebWorker } from 'vs/base/common/platform'; +@@ -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 { diff --git a/vscode-paches/0021-fix-override-log-services-even-in-main-thread.patch b/vscode-paches/0020-fix-override-log-services-even-in-main-thread.patch similarity index 50% rename from vscode-paches/0021-fix-override-log-services-even-in-main-thread.patch rename to vscode-paches/0020-fix-override-log-services-even-in-main-thread.patch index 240ba550..330a7571 100644 --- a/vscode-paches/0021-fix-override-log-services-even-in-main-thread.patch +++ b/vscode-paches/0020-fix-override-log-services-even-in-main-thread.patch @@ -4,21 +4,30 @@ 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 | 5 +++++ + src/vs/workbench/api/common/extensionHostMain.ts | 7 ++++++- src/vs/workbench/api/worker/extHost.worker.services.ts | 4 ---- - 2 files changed, 5 insertions(+), 4 deletions(-) + 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 b06a1560fa6..ac932a43faa 100644 +index 3089e188325..41fa0fa3ca9 100644 --- a/src/vs/workbench/api/common/extensionHostMain.ts +++ b/src/vs/workbench/api/common/extensionHostMain.ts -@@ -24,6 +24,9 @@ import { IExtHostExtensionService, IHostUtils } from 'vs/workbench/api/common/ex - import { IExtHostTelemetry } from 'vs/workbench/api/common/extHostTelemetry'; - import { Mutable } from 'vs/base/common/types'; - import { isWebWorker } from 'vs/base/common/platform'; -+import { ExtHostLogService } from 'vs/workbench/api/common/extHostLogService'; -+import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; -+import { ExtHostLoggerService } from 'vs/workbench/api/common/extHostLoggerService'; +@@ -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; @@ -32,22 +41,22 @@ index b06a1560fa6..ac932a43faa 100644 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 20ec7e138a6..e284ed6752b 100644 +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 'vs/platform/instantiation/common/descriptors'; - import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; --import { ILogService } from 'vs/platform/log/common/log'; - import { IExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; --import { ExtHostLogService } from 'vs/workbench/api/common/extHostLogService'; - import { ExtensionStoragePaths, IExtensionStoragePaths } from 'vs/workbench/api/common/extHostStoragePaths'; - import { ExtHostExtensionService } from 'vs/workbench/api/worker/extHostExtensionService'; +-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 'vs/workbench/api/worker/extHostExtensio +@@ -17,6 +14,5 @@ import { ExtHostExtensionService } from './extHostExtensionService.js'; // ### ### // ######################################################################### diff --git a/vscode-paches/0022-feat-expose-extHostExtensionService.patch b/vscode-paches/0021-feat-expose-extHostExtensionService.patch similarity index 50% rename from vscode-paches/0022-feat-expose-extHostExtensionService.patch rename to vscode-paches/0021-feat-expose-extHostExtensionService.patch index 6e3a219a..12586f19 100644 --- a/vscode-paches/0022-feat-expose-extHostExtensionService.patch +++ b/vscode-paches/0021-feat-expose-extHostExtensionService.patch @@ -4,22 +4,13 @@ Date: Mon, 11 Mar 2024 17:47:22 +0100 Subject: [PATCH] feat: expose extHostExtensionService --- - src/vs/workbench/api/common/extensionHostMain.ts | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) + 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 ac932a43faa..134d9884b5d 100644 +index 41fa0fa3ca9..72f8b35a069 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 'vs/workbench/api/common/ext - import { IExtensionHostInitData } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; - import { RPCProtocol } from 'vs/workbench/services/extensions/common/rpcProtocol'; - import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions'; --import { ILogService } from 'vs/platform/log/common/log'; -+import { ILogService, ILoggerService } from 'vs/platform/log/common/log'; - import { getSingletonServiceDescriptors } from 'vs/platform/instantiation/common/extensions'; - import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; - import { IExtHostInitDataService } from 'vs/workbench/api/common/extHostInitDataService'; @@ -208,6 +208,10 @@ export class ExtensionHostMain { this._extensionService.terminate(reason); } diff --git a/vscode-paches/0023-cleanup-remove-non-ESM-compatible-code.patch b/vscode-paches/0022-cleanup-remove-non-ESM-compatible-code.patch similarity index 70% rename from vscode-paches/0023-cleanup-remove-non-ESM-compatible-code.patch rename to vscode-paches/0022-cleanup-remove-non-ESM-compatible-code.patch index ad1721c2..72ea9b22 100644 --- a/vscode-paches/0023-cleanup-remove-non-ESM-compatible-code.patch +++ b/vscode-paches/0022-cleanup-remove-non-ESM-compatible-code.patch @@ -7,27 +7,27 @@ Subject: [PATCH] cleanup: remove non-ESM compatible code src/vs/base/common/worker/simpleWorker.ts | 41 +------------------ .../common/services/editorSimpleWorker.ts | 23 +---------- .../api/node/extensionHostProcess.ts | 18 -------- - .../webWorkerExtensionHostIframe.esm.html | 9 +--- - 4 files changed, 4 insertions(+), 87 deletions(-) + .../webWorkerExtensionHostIframe.esm.html | 7 +--- + 4 files changed, 3 insertions(+), 86 deletions(-) diff --git a/src/vs/base/common/worker/simpleWorker.ts b/src/vs/base/common/worker/simpleWorker.ts -index cf19e69171a..fafef7ac754 100644 +index f08369f98cf..1e61f4c8fe2 100644 --- a/src/vs/base/common/worker/simpleWorker.ts +++ b/src/vs/base/common/worker/simpleWorker.ts -@@ -7,18 +7,10 @@ import { CharCode } from 'vs/base/common/charCode'; - import { onUnexpectedError, transformErrorForSerialization } from 'vs/base/common/errors'; - import { Emitter, Event } from 'vs/base/common/event'; - import { Disposable, IDisposable } from 'vs/base/common/lifecycle'; --import { AppResourcePath, FileAccess } from 'vs/base/common/network'; - import { isWeb } from 'vs/base/common/platform'; - import * as strings from 'vs/base/common/strings'; - import { URI } from 'vs/base/common/uri'; +@@ -7,18 +7,10 @@ import { CharCode } from '../charCode.js'; + import { onUnexpectedError, transformErrorForSerialization } from '../errors.js'; + import { Emitter, Event } from '../event.js'; + import { Disposable, IDisposable } from '../lifecycle.js'; +-import { AppResourcePath, FileAccess } from '../network.js'; + import { isWeb } from '../platform.js'; + import * as strings from '../strings.js'; + import { URI } from '../uri.js'; -// ESM-comment-begin --const isESM = false; +-// const isESM = false; -// ESM-comment-end -// ESM-uncomment-begin --// const isESM = true; +-const isESM = true; -// ESM-uncomment-end - const DEFAULT_CHANNEL = 'default'; @@ -52,10 +52,10 @@ index cf19e69171a..fafef7ac754 100644 - // Use the global require to be sure to get the global config - - // ESM-comment-begin -- const req = (globalThis.require || require); +- // const req = (globalThis.require || require); - // ESM-comment-end - // ESM-uncomment-begin -- // const req = globalThis.require; +- const req = globalThis.require; - // ESM-uncomment-end - - req([moduleId], (module: { create: IRequestHandlerFactory }) => { @@ -74,25 +74,25 @@ index cf19e69171a..fafef7ac754 100644 } diff --git a/src/vs/editor/common/services/editorSimpleWorker.ts b/src/vs/editor/common/services/editorSimpleWorker.ts -index 4bf19b0d25e..7d9721053c1 100644 +index ff8bbb85464..b0163997f9b 100644 --- a/src/vs/editor/common/services/editorSimpleWorker.ts +++ b/src/vs/editor/common/services/editorSimpleWorker.ts -@@ -25,20 +25,12 @@ import { DetailedLineRangeMapping } from '../diff/rangeMapping'; - import { linesDiffComputers } from 'vs/editor/common/diff/linesDiffComputers'; - import { createProxyObject, getAllMethodNames } from 'vs/base/common/objects'; - import { IDocumentDiffProviderOptions } from 'vs/editor/common/diff/documentDiffProvider'; --import { AppResourcePath, FileAccess } from 'vs/base/common/network'; - import { BugIndicatingError } from 'vs/base/common/errors'; - import { computeDefaultDocumentColors } from 'vs/editor/common/languages/defaultDocumentColorsComputer'; - import { FindSectionHeaderOptions, SectionHeader, findSectionHeaders } from 'vs/editor/common/services/findSectionHeaders'; - import { IRawModelData, IWorkerTextModelSyncChannelServer } from './textModelSync/textModelSync.protocol'; - import { ICommonModel, WorkerTextModelSyncServer } from 'vs/editor/common/services/textModelSync/textModelSync.impl'; +@@ -25,20 +25,12 @@ import { DetailedLineRangeMapping } from '../diff/rangeMapping.js'; + import { linesDiffComputers } from '../diff/linesDiffComputers.js'; + import { createProxyObject, getAllMethodNames } from '../../../base/common/objects.js'; + import { IDocumentDiffProviderOptions } from '../diff/documentDiffProvider.js'; +-import { AppResourcePath, FileAccess } from '../../../base/common/network.js'; + import { BugIndicatingError } from '../../../base/common/errors.js'; + import { computeDefaultDocumentColors } from '../languages/defaultDocumentColorsComputer.js'; + import { FindSectionHeaderOptions, SectionHeader, findSectionHeaders } from './findSectionHeaders.js'; + import { IRawModelData, IWorkerTextModelSyncChannelServer } from './textModelSync/textModelSync.protocol.js'; + import { ICommonModel, WorkerTextModelSyncServer } from './textModelSync/textModelSync.impl.js'; -// ESM-comment-begin --const isESM = false; +-// const isESM = false; -// ESM-comment-end -// ESM-uncomment-begin --// const isESM = true; +-const isESM = true; -// ESM-uncomment-end - export interface IMirrorModel extends IMirrorTextModel { @@ -121,10 +121,10 @@ index 4bf19b0d25e..7d9721053c1 100644 // foreign method request diff --git a/src/vs/workbench/api/node/extensionHostProcess.ts b/src/vs/workbench/api/node/extensionHostProcess.ts -index 80a60c1d4c1..5f1736f72a0 100644 +index 694559385c4..0be2f11f004 100644 --- a/src/vs/workbench/api/node/extensionHostProcess.ts +++ b/src/vs/workbench/api/node/extensionHostProcess.ts -@@ -57,24 +57,6 @@ const args = minimist(process.argv.slice(2), { +@@ -60,24 +60,6 @@ const args = minimist(process.argv.slice(2), { ] }) as ParsedExtHostArgs; @@ -134,7 +134,7 @@ index 80a60c1d4c1..5f1736f72a0 100644 -// happening we essentially blocklist this module from getting loaded in any -// extension by patching the node require() function. -(function () { -- const Module = globalThis._VSCODE_NODE_MODULES.module as any; +- const Module = require('module'); - const originalLoad = Module._load; - - Module._load = function (request: string) { @@ -150,15 +150,15 @@ index 80a60c1d4c1..5f1736f72a0 100644 const nativeExit: IExitFn = process.exit.bind(process); const nativeOn = process.on.bind(process); diff --git a/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html b/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html -index 5368e599820..908984d7dc2 100644 +index 53bc54bb5aa..9a3c7cec21d 100644 --- a/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html +++ b/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html @@ -4,7 +4,7 @@ @@ -167,12 +167,11 @@ index 5368e599820..908984d7dc2 100644 } - // ESM-comment-begin -- const isESM = false; +- // const isESM = false; - // ESM-comment-end - // ESM-uncomment-begin -- // const isESM = true; + const isESM = true; - // ESM-uncomment-end -+ const isESM = true; - const blob = new Blob([[ - `/*extensionHostWorker*/`, + // In below blob code, we are using JSON.stringify to ensure the passed + // in values are not breaking our script. The values may contain string diff --git a/vscode-paches/0024-feat-expose-api-factory.patch b/vscode-paches/0023-feat-expose-api-factory.patch similarity index 79% rename from vscode-paches/0024-feat-expose-api-factory.patch rename to vscode-paches/0023-feat-expose-api-factory.patch index f0e63257..991be7d7 100644 --- a/vscode-paches/0024-feat-expose-api-factory.patch +++ b/vscode-paches/0023-feat-expose-api-factory.patch @@ -8,18 +8,18 @@ Subject: [PATCH] feat: expose api factory 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 5ce2ec7413b..5555f431ba0 100644 +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 'vs/workbench/api/common/extHost.api.impl'; -+import { IExtensionApiFactory, createApiFactoryAndRegisterActors } from 'vs/workbench/api/common/extHost.api.impl'; - import { ExtensionActivationTimesBuilder } from 'vs/workbench/api/common/extHostExtensionActivator'; - import { AbstractExtHostExtensionService } from 'vs/workbench/api/common/extHostExtensionService'; - import { URI } from 'vs/base/common/uri'; +-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; diff --git a/vscode-paches/0025-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 similarity index 92% rename from vscode-paches/0025-refactor-split-some-modules-to-be-able-to-import-the.patch rename to vscode-paches/0024-refactor-split-some-modules-to-be-able-to-import-the.patch index 471b3007..153f597c 100644 --- a/vscode-paches/0025-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 @@ -8,13 +8,13 @@ Subject: [PATCH] refactor: split some modules to be able to import them .../editor/editor.contribution._autosave.ts | 9 + .../parts/editor/editor.contribution.ts | 3 +- .../files/browser/fileCommands._save.ts | 225 ++++++ - .../contrib/files/browser/fileCommands.ts | 221 +----- + .../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, 940 insertions(+), 870 deletions(-) + 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 @@ -38,22 +38,22 @@ index 00000000000..c7416d68719 + +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 753f4aa8860..6effe9075e1 100644 +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 'vs/base/common/platform'; - import { EditorContributionInstantiation, registerEditorContribution } from 'vs/editor/browser/editorExtensions'; - import { FloatingEditorClickMenu } from 'vs/workbench/browser/codeeditor'; - import { WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; --import { EditorAutoSave } from 'vs/workbench/browser/parts/editor/editorAutoSave'; - import { IQuickAccessRegistry, Extensions as QuickAccessExtensions } from 'vs/platform/quickinput/common/quickAccess'; - import { ActiveGroupEditorsByMostRecentlyUsedQuickAccess, AllEditorsByAppearanceQuickAccess, AllEditorsByMostRecentlyUsedQuickAccess } from 'vs/workbench/browser/parts/editor/editorQuickAccess'; - import { FileAccess } from 'vs/base/common/network'; -@@ -72,6 +71,7 @@ import { DynamicEditorConfigurations } from 'vs/workbench/browser/parts/editor/e - import { ConfigureEditorAction, ConfigureEditorTabsAction, EditorActionsDefaultAction, EditorActionsTitleBarAction, HideEditorActionsAction, HideEditorTabsAction, ShowMultipleEditorTabsAction, ShowSingleEditorTabAction, ZenHideEditorTabsAction, ZenShowMultipleEditorTabsAction, ZenShowSingleEditorTabAction } from 'vs/workbench/browser/actions/layoutActions'; - import { ICommandAction } from 'vs/platform/action/common/action'; - import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; -+import './editor.contribution._autosave'; +@@ -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 @@ -297,74 +297,71 @@ index 00000000000..00d9d64137d + } +}); diff --git a/src/vs/workbench/contrib/files/browser/fileCommands.ts b/src/vs/workbench/contrib/files/browser/fileCommands.ts -index c17a5b80692..501b58373c1 100644 +index 69cfd27a424..484b77a02f7 100644 --- a/src/vs/workbench/contrib/files/browser/fileCommands.ts +++ b/src/vs/workbench/contrib/files/browser/fileCommands.ts -@@ -3,10 +3,10 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ +@@ -5,8 +5,7 @@ -+ - 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 { EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor'; - import { IWindowOpenable, IOpenWindowOptions, isWorkspaceToOpen, IOpenEmptyWindowOptions } from 'vs/platform/window/common/window'; - import { IHostService } from 'vs/workbench/services/host/browser/host'; - import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -@@ -14,7 +14,6 @@ import { IWorkspaceContextService, UNTITLED_WORKSPACE_NAME } from 'vs/platform/w - import { ExplorerFocusCondition, TextFileContentProvider, VIEWLET_ID, ExplorerCompressedFocusContext, ExplorerCompressedFirstFocusContext, ExplorerCompressedLastFocusContext, FilesExplorerFocusCondition, ExplorerFolderContext, VIEW_ID } from 'vs/workbench/contrib/files/common/files'; - import { ExplorerViewPaneContainer } from 'vs/workbench/contrib/files/browser/explorerViewlet'; - import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; --import { toErrorMessage } from 'vs/base/common/errorMessage'; - import { CommandsRegistry, ICommandHandler, ICommandService } from 'vs/platform/commands/common/commands'; - import { IContextKey, IContextKeyService, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; - import { IFileService } from 'vs/platform/files/common/files'; -@@ -22,36 +21,29 @@ import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/co - import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes'; - import { isWeb, isWindows } from 'vs/base/common/platform'; - import { ITextModelService } from 'vs/editor/common/services/resolverService'; --import { getResourceForCommand, getMultiSelectedResources, getOpenEditorsViewMultiSelection, IExplorerService } from 'vs/workbench/contrib/files/browser/files'; -+import { getResourceForCommand, getMultiSelectedResources, IExplorerService } from 'vs/workbench/contrib/files/browser/files'; - import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing'; --import { resolveCommandsContext } from 'vs/workbench/browser/parts/editor/editorCommandsContext'; - import { Schemas } from 'vs/base/common/network'; --import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; - import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; --import { IEditorService, SIDE_GROUP, ISaveEditorsOptions } from 'vs/workbench/services/editor/common/editorService'; --import { IEditorGroupsService, GroupsOrder, IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService'; -+import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -+import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; - import { ILabelService } from 'vs/platform/label/common/label'; --import { basename, joinPath, isEqual } from 'vs/base/common/resources'; -+import { basename, joinPath } from 'vs/base/common/resources'; - import { IDisposable, dispose } from 'vs/base/common/lifecycle'; - import { IEnvironmentService } from 'vs/platform/environment/common/environment'; --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 { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'; --import { isCancellationError } from 'vs/base/common/errors'; --import { IAction, toAction } from 'vs/base/common/actions'; - import { EditorOpenSource, EditorResolution } from 'vs/platform/editor/common/editor'; --import { hash } from 'vs/base/common/hash'; - import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; - import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite'; - import { ViewContainerLocation } from 'vs/workbench/common/views'; - import { IViewsService } from 'vs/workbench/services/views/common/viewsService'; --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'; -+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'; - import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; - import { RemoveRootFolderAction } from 'vs/workbench/browser/actions/workspaceActions'; - import { OpenEditorsView } from 'vs/workbench/contrib/files/browser/views/openEditorsView'; - import { ExplorerView } from 'vs/workbench/contrib/files/browser/views/explorerView'; - import { IListService } from 'vs/platform/list/browser/listService'; -+import './fileCommands._save'; + 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)) { -@@ -362,203 +354,6 @@ CommandsRegistry.registerCommand({ +@@ -364,203 +355,6 @@ CommandsRegistry.registerCommand({ // Save / Save As / Save All / Revert @@ -570,7 +567,7 @@ index c17a5b80692..501b58373c1 100644 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..b44c86e2c7e +index 00000000000..b7d4ca80081 --- /dev/null +++ b/src/vs/workbench/contrib/files/browser/files.contribution._configuration.ts @@ -0,0 +1,297 @@ @@ -765,7 +762,7 @@ index 00000000000..b44c86e2c7e + 'patternProperties': { + '.*': { 'type': 'boolean' } + }, -+ 'default': { '**/.git/objects/**': true, '**/.git/subtree-cache/**': true, '**/node_modules/*/**': true, '**/.hg/store/**': true }, ++ '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 + }, @@ -1286,45 +1283,45 @@ index 00000000000..2f31d6a7984 + } +}); diff --git a/src/vs/workbench/contrib/files/browser/files.contribution.ts b/src/vs/workbench/contrib/files/browser/files.contribution.ts -index 097721653f6..fa00f1d55a1 100644 +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 'vs/nls'; --import { sep } from 'vs/base/common/path'; --import { Registry } from 'vs/platform/registry/common/platform'; --import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry'; --import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; --import { IFileEditorInput, IEditorFactoryRegistry, EditorExtensions } from 'vs/workbench/common/editor'; --import { AutoSaveConfiguration, HotExitConfiguration, FILES_EXCLUDE_CONFIG, FILES_ASSOCIATIONS_CONFIG, FILES_READONLY_INCLUDE_CONFIG, FILES_READONLY_EXCLUDE_CONFIG, FILES_READONLY_FROM_PERMISSIONS_CONFIG } from 'vs/platform/files/common/files'; --import { SortOrder, LexicographicOptions, FILE_EDITOR_INPUT_ID, BINARY_TEXT_FILE_MODE, UndoConfirmLevel, IFilesConfiguration } from 'vs/workbench/contrib/files/common/files'; --import { TextFileEditorTracker } from 'vs/workbench/contrib/files/browser/editors/textFileEditorTracker'; --import { TextFileSaveErrorHandler } from 'vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler'; --import { FileEditorInput } from 'vs/workbench/contrib/files/browser/editors/fileEditorInput'; --import { BinaryFileEditor } from 'vs/workbench/contrib/files/browser/editors/binaryFileEditor'; --import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; --import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; --import { isNative, isWeb, isWindows } from 'vs/base/common/platform'; --import { ExplorerViewletViewsContribution } from 'vs/workbench/contrib/files/browser/explorerViewlet'; --import { IEditorPaneRegistry, EditorPaneDescriptor } from 'vs/workbench/browser/editor'; --import { ILabelService } from 'vs/platform/label/common/label'; --import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; --import { ExplorerService, UNDO_REDO_SOURCE } from 'vs/workbench/contrib/files/browser/explorerService'; --import { GUESSABLE_ENCODINGS, SUPPORTED_ENCODINGS } from 'vs/workbench/services/textfile/common/encoding'; --import { Schemas } from 'vs/base/common/network'; --import { WorkspaceWatcher } from 'vs/workbench/contrib/files/browser/workspaceWatcher'; --import { editorConfigurationBaseNode } from 'vs/editor/common/config/editorConfigurationSchema'; --import { DirtyFilesIndicator } from 'vs/workbench/contrib/files/common/dirtyFilesIndicator'; --import { UndoCommand, RedoCommand } from 'vs/editor/browser/editorExtensions'; --import { IUndoRedoService } from 'vs/platform/undoRedo/common/undoRedo'; --import { IExplorerService } from 'vs/workbench/contrib/files/browser/files'; --import { FileEditorInputSerializer, FileEditorWorkingCopyEditorHandler } from 'vs/workbench/contrib/files/browser/editors/fileEditorHandler'; --import { ModesRegistry } from 'vs/editor/common/languages/modesRegistry'; --import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; --import { TextFileEditor } from 'vs/workbench/contrib/files/browser/editors/textFileEditor'; +-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 { - @@ -1585,7 +1582,7 @@ index 097721653f6..fa00f1d55a1 100644 - 'patternProperties': { - '.*': { 'type': 'boolean' } - }, -- 'default': { '**/.git/objects/**': true, '**/.git/subtree-cache/**': true, '**/node_modules/*/**': true, '**/.hg/store/**': true }, +- '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 - }, @@ -1948,7 +1945,7 @@ index 097721653f6..fa00f1d55a1 100644 - aliases: ['Binary'], - mimetypes: ['text/x-code-binary'] -}); -+import './files.contribution._configuration'; -+import './files.contribution._editorPane'; -+import './files.contribution._fileEditorFactory'; -+import './files.contribution._explorer'; ++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/0026-fix-replace-map-by-forEach.patch b/vscode-paches/0025-fix-replace-map-by-forEach.patch similarity index 93% rename from vscode-paches/0026-fix-replace-map-by-forEach.patch rename to vscode-paches/0025-fix-replace-map-by-forEach.patch index 1e6ee5e8..db0b72db 100644 --- a/vscode-paches/0026-fix-replace-map-by-forEach.patch +++ b/vscode-paches/0025-fix-replace-map-by-forEach.patch @@ -9,10 +9,10 @@ Subject: [PATCH] fix: replace map by forEach 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 a9fc39c84ed..957684aa7f7 100644 +index 5e83a9458bd..1a3545c6e24 100644 --- a/src/vs/workbench/browser/parts/compositeBar.ts +++ b/src/vs/workbench/browser/parts/compositeBar.ts -@@ -477,7 +477,7 @@ export class CompositeBar extends Widget implements ICompositeBar { +@@ -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)); @@ -22,7 +22,7 @@ index a9fc39c84ed..957684aa7f7 100644 : 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 9cb5f5920d1..4f591b9ce05 100644 +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 { diff --git a/vscode-paches/0027-feat-only-apply-style-on-specific-class.patch b/vscode-paches/0026-feat-only-apply-style-on-specific-class.patch similarity index 99% rename from vscode-paches/0027-feat-only-apply-style-on-specific-class.patch rename to vscode-paches/0026-feat-only-apply-style-on-specific-class.patch index e8b5e47c..6e889c12 100644 --- a/vscode-paches/0027-feat-only-apply-style-on-specific-class.patch +++ b/vscode-paches/0026-feat-only-apply-style-on-specific-class.patch @@ -355,7 +355,7 @@ index 6c9dbb9a0c9..4b381ddf79c 100644 outline-offset: -1px; } diff --git a/src/vs/workbench/browser/style.ts b/src/vs/workbench/browser/style.ts -index 8fab9bc5b71..30f20a45b2a 100644 +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) => { diff --git a/vscode-paches/0028-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch b/vscode-paches/0027-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch similarity index 64% rename from vscode-paches/0028-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch rename to vscode-paches/0027-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch index c4ceb233..aa511959 100644 --- a/vscode-paches/0028-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch +++ b/vscode-paches/0027-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch @@ -13,19 +13,19 @@ to be able to register the file before 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 a298cf3c232..f91b7cc7398 100644 +index f6873bf5524..b653ac57a36 100644 --- a/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts +++ b/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.ts -@@ -42,7 +42,7 @@ import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsSe - import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; - import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; - import { Extensions, IExtensionFeaturesManagementService, IExtensionFeaturesRegistry } from 'vs/workbench/services/extensionManagement/common/extensionFeatures'; --import { DefaultIconPath, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; -+import { getDefaultIconPath, EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; - import { LocalWebWorkerRunningLocation } from 'vs/workbench/services/extensions/common/extensionRunningLocation'; - import { IExtensionHostProfile, IExtensionService, IExtensionsStatus } from 'vs/workbench/services/extensions/common/extensions'; - -@@ -276,8 +276,8 @@ export abstract class AbstractRuntimeExtensionsEditor extends EditorPane { +@@ -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); @@ -37,19 +37,19 @@ index a298cf3c232..f91b7cc7398 100644 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 ba69585c920..08fb07a831c 100644 +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 'vs/platform/extensionManagement/common/extensionManagement'; --import { IWorkbenchExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer, IWorkbenchExtensionManagementService, DefaultIconPath, IResourceExtension, extensionsConfigurationNodeBase } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; -+import { IWorkbenchExtensionEnablementService, EnablementState, IExtensionManagementServerService, IExtensionManagementServer, IWorkbenchExtensionManagementService, getDefaultIconPath, IResourceExtension, extensionsConfigurationNodeBase } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; - import { getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData, areSameExtensions, groupByExtension, getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; - import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; - import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -@@ -271,7 +271,7 @@ export class Extension implements IExtension { + } 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 { } } } @@ -59,15 +59,15 @@ index ba69585c920..08fb07a831c 100644 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 afff5c25809..28b50d2e885 100644 +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 'vs/platform/telemetry/common/telemetry'; - import { checkGlobFileExists } from 'vs/workbench/services/extensions/common/workspaceContains'; - import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; - import { CancellationTokenSource } from 'vs/base/common/cancellation'; --import { DefaultIconPath } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; -+import { getDefaultIconPath } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; +@@ -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); @@ -81,10 +81,10 @@ index afff5c25809..28b50d2e885 100644 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 4886c6ff699..9888464405d 100644 +index 0244e0aa381..5bd87b4b5ab 100644 --- a/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts +++ b/src/vs/workbench/services/extensionManagement/common/extensionManagement.ts -@@ -40,7 +40,7 @@ export interface IExtensionManagementServerService { +@@ -43,7 +43,7 @@ export interface IExtensionManagementServerService { getExtensionInstallLocation(extension: IExtension): ExtensionInstallLocation | null; } diff --git a/vscode-paches/0029-cleanup-remove-some-checks-and-warnings.patch b/vscode-paches/0028-cleanup-remove-some-checks-and-warnings.patch similarity index 93% rename from vscode-paches/0029-cleanup-remove-some-checks-and-warnings.patch rename to vscode-paches/0028-cleanup-remove-some-checks-and-warnings.patch index 5d5bb8d9..9cee4389 100644 --- a/vscode-paches/0029-cleanup-remove-some-checks-and-warnings.patch +++ b/vscode-paches/0028-cleanup-remove-some-checks-and-warnings.patch @@ -25,7 +25,7 @@ index e5fa674ea82..c3e8d26f3da 100644 }); } diff --git a/src/vs/workbench/contrib/webview/browser/webviewElement.ts b/src/vs/workbench/contrib/webview/browser/webviewElement.ts -index 8870ddf4cc6..6bc4e3293c6 100644 +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 @@ -53,7 +53,7 @@ index 8870ddf4cc6..6bc4e3293c6 100644 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 4e9dc37e3f4..10fb6ae0300 100644 +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 @@ -71,7 +71,7 @@ index 4e9dc37e3f4..10fb6ae0300 100644 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 0c2e68dd1ec..6aa219f71f8 100644 +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 @@ -84,16 +84,16 @@ index 0c2e68dd1ec..6aa219f71f8 100644 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 a1a0779371e..18ca6d1b496 100644 +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 'vs/base/common/resources'; - import { URI } from 'vs/base/common/uri'; - import { LanguageId, StandardTokenType } from 'vs/editor/common/encodedTokenAttributes'; +-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 { } diff --git a/vscode-paches/0030-refactor-split-class-in-2.patch b/vscode-paches/0029-refactor-split-class-in-2.patch similarity index 97% rename from vscode-paches/0030-refactor-split-class-in-2.patch rename to vscode-paches/0029-refactor-split-class-in-2.patch index d436acd3..55bbda00 100644 --- a/vscode-paches/0030-refactor-split-class-in-2.patch +++ b/vscode-paches/0029-refactor-split-class-in-2.patch @@ -8,11 +8,11 @@ Subject: [PATCH] refactor: split class in 2 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 83bce6798aa..c97b6de14b8 100644 +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 'vs/workbench/services/userData/b - import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile'; +@@ -43,8 +43,10 @@ import { IUserDataInitializationService } from '../../userData/browser/userDataI + import { IUserDataProfileService } from '../../userDataProfile/common/userDataProfile.js'; export class ExtensionService extends AbstractExtensionService implements IExtensionService { - diff --git a/vscode-paches/0031-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 similarity index 76% rename from vscode-paches/0031-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch rename to vscode-paches/0030-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch index 388a28bd..234baff2 100644 --- a/vscode-paches/0031-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 @@ -10,18 +10,18 @@ Subject: [PATCH] fix: mark process supported as soon as there is a registered 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 62a129b809d..0a1a2490bef 100644 +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 'vs/base/common/event'; -+import { Emitter, Event } from 'vs/base/common/event'; - import { IProcessEnvironment, OperatingSystem } from 'vs/base/common/platform'; - import { URI, UriComponents } from 'vs/base/common/uri'; - import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; +-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' }; @@ -79,26 +79,26 @@ index 62a129b809d..0a1a2490bef 100644 } 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 2dc85842d94..aad999896ea 100644 +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 'vs/platform/contextkey/common/c - import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; - import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; - import { INotificationService } from 'vs/platform/notification/common/notification'; --import { ICreateContributedTerminalProfileOptions, IExtensionTerminalProfile, IPtyHostAttachTarget, IRawTerminalInstanceLayoutInfo, IRawTerminalTabLayoutInfo, IShellLaunchConfig, ITerminalBackend, ITerminalLaunchError, ITerminalLogService, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, TerminalExitReason, TerminalLocation, TerminalLocationString, TitleEventSource } from 'vs/platform/terminal/common/terminal'; -+import { ICreateContributedTerminalProfileOptions, IExtensionTerminalProfile, IPtyHostAttachTarget, IRawTerminalInstanceLayoutInfo, IRawTerminalTabLayoutInfo, IShellLaunchConfig, ITerminalBackend, ITerminalBackendRegistry, ITerminalLaunchError, ITerminalLogService, ITerminalsLayoutInfo, ITerminalsLayoutInfoById, TerminalExitReason, TerminalExtensions, TerminalLocation, TerminalLocationString, TitleEventSource } from 'vs/platform/terminal/common/terminal'; - import { formatMessageForTerminal } from 'vs/platform/terminal/common/terminalStrings'; - import { iconForeground } from 'vs/platform/theme/common/colorRegistry'; - import { getIconRegistry } from 'vs/platform/theme/common/iconRegistry'; -@@ -53,6 +53,7 @@ import { TerminalCapabilityStore } from 'vs/platform/terminal/common/capabilitie - import { ITimerService } from 'vs/workbench/services/timer/browser/timerService'; - import { mark } from 'vs/base/common/performance'; - import { DetachedTerminal } from 'vs/workbench/contrib/terminal/browser/detachedTerminal'; -+import { Registry } from 'vs/platform/registry/common/platform'; - import { ITerminalCapabilityImplMap, TerminalCapability } from 'vs/platform/terminal/common/capabilities/capabilities'; - import { createInstanceCapabilityEventMultiplexer } from 'vs/workbench/contrib/terminal/browser/terminalEvents'; - import { mainWindow } from 'vs/base/browser/window'; +@@ -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); diff --git a/vscode-paches/0032-fix-use-asBrowserUri-to-get-iframe-src.patch b/vscode-paches/0031-fix-use-asBrowserUri-to-get-iframe-src.patch similarity index 97% rename from vscode-paches/0032-fix-use-asBrowserUri-to-get-iframe-src.patch rename to vscode-paches/0031-fix-use-asBrowserUri-to-get-iframe-src.patch index 959f4967..f7dd1934 100644 --- a/vscode-paches/0032-fix-use-asBrowserUri-to-get-iframe-src.patch +++ b/vscode-paches/0031-fix-use-asBrowserUri-to-get-iframe-src.patch @@ -8,7 +8,7 @@ Subject: [PATCH] fix: use asBrowserUri to get iframe src 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 6bc4e3293c6..b7a9e51144f 100644 +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 diff --git a/vscode-paches/0033-feat-add-some-parameter-to-webview-iframes.patch b/vscode-paches/0032-feat-add-some-parameter-to-webview-iframes.patch similarity index 65% rename from vscode-paches/0033-feat-add-some-parameter-to-webview-iframes.patch rename to vscode-paches/0032-feat-add-some-parameter-to-webview-iframes.patch index 61d6e35b..e2c9c7cc 100644 --- a/vscode-paches/0033-feat-add-some-parameter-to-webview-iframes.patch +++ b/vscode-paches/0032-feat-add-some-parameter-to-webview-iframes.patch @@ -8,18 +8,18 @@ Subject: [PATCH] feat: add some parameter to webview iframes 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 b7a9e51144f..be42aaaeff3 100644 +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 'vs/base/common/buffer'; - import { CancellationTokenSource } from 'vs/base/common/cancellation'; - import { Emitter, Event } from 'vs/base/common/event'; - import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; --import { COI } from 'vs/base/common/network'; -+import { COI, FileAccess } from 'vs/base/common/network'; - import { URI } from 'vs/base/common/uri'; - import { generateUuid } from 'vs/base/common/uuid'; - import { localize } from 'vs/nls'; +@@ -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; } diff --git a/vscode-paches/0034-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 similarity index 95% rename from vscode-paches/0034-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch rename to vscode-paches/0033-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch index 8f6f6bed..9cf3c23a 100644 --- a/vscode-paches/0034-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 @@ -8,10 +8,10 @@ Subject: [PATCH] fix: only detect fullscreen if it's not a guess 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 253828dfd74..3559cd01d99 100644 +index 88d7b0db4c2..7499230f9ed 100644 --- a/src/vs/workbench/services/host/browser/browserHostService.ts +++ b/src/vs/workbench/services/host/browser/browserHostService.ts -@@ -215,13 +215,18 @@ export class BrowserHostService extends Disposable implements IHostService { +@@ -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 */; diff --git a/vscode-paches/0035-fix-only-use-open-model.patch b/vscode-paches/0034-fix-only-use-open-model.patch similarity index 90% rename from vscode-paches/0035-fix-only-use-open-model.patch rename to vscode-paches/0034-fix-only-use-open-model.patch index d1547cef..c867fee0 100644 --- a/vscode-paches/0035-fix-only-use-open-model.patch +++ b/vscode-paches/0034-fix-only-use-open-model.patch @@ -8,7 +8,7 @@ Subject: [PATCH] fix: only use open model 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 8067c690fa3..b5cd1fbd527 100644 +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 @@ @@ -16,12 +16,12 @@ index 8067c690fa3..b5cd1fbd527 100644 *--------------------------------------------------------------------------------------------*/ -import type { ModelOperations, ModelResult } from '@vscode/vscode-languagedetection'; --import { importAMDNodeModule } from 'vs/amdX'; +-import { importAMDNodeModule } from '../../../../amdX.js'; +import { ModelOperations, ModelResult } from '@vscode/vscode-languagedetection'; - import { StopWatch } from 'vs/base/common/stopwatch'; - import { IRequestHandler, IWorkerServer } from 'vs/base/common/worker/simpleWorker'; - import { LanguageDetectionWorkerHost, ILanguageDetectionWorker } from 'vs/workbench/services/languageDetection/browser/languageDetectionWorker.protocol'; - import { WorkerTextModelSyncServer } from 'vs/editor/common/services/textModelSync/textModelSync.impl'; + 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 }; - diff --git a/vscode-paches/0036-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch b/vscode-paches/0035-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch similarity index 69% rename from vscode-paches/0036-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch rename to vscode-paches/0035-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch index 556ed3a5..c55d11bc 100644 --- a/vscode-paches/0036-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch +++ b/vscode-paches/0035-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch @@ -8,14 +8,14 @@ Subject: [PATCH] fix: replace CJS require by FileAccess.toModuleContent 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 9cc4cdf407c..7fbc00d48a7 100644 +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 'vs/platform/notification/common/notificati - import { ILanguageService } from 'vs/editor/common/languages/language'; - import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; - import { gettingStartedContentRegistry } from 'vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent'; -+import { AppResourcePath, FileAccess } from 'vs/base/common/network'; +@@ -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 { diff --git a/vscode-paches/0037-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 similarity index 72% rename from vscode-paches/0037-fix-allow-adding-a-local-folder-even-when-there-is-a.patch rename to vscode-paches/0036-fix-allow-adding-a-local-folder-even-when-there-is-a.patch index 494d3d63..d1abeaca 100644 --- a/vscode-paches/0037-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 @@ -9,18 +9,18 @@ Subject: [PATCH] fix: allow adding a local folder even when there is a remote 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 a3be20f5277..2261767327a 100644 +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 'vs/platform/registry/common/platform'; - import { ICommandService } from 'vs/platform/commands/common/commands'; - import { distinct, firstOrDefault } from 'vs/base/common/arrays'; --import { basename, isEqual, isEqualAuthority, joinPath, removeTrailingPathSeparator } from 'vs/base/common/resources'; -+import { basename, isEqual, joinPath, removeTrailingPathSeparator } from 'vs/base/common/resources'; - import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; - import { IFileService } from 'vs/platform/files/common/files'; - import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; + 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 { diff --git a/vscode-paches/0038-feat-allow-to-switch-storage-service-workspace.patch b/vscode-paches/0037-feat-allow-to-switch-storage-service-workspace.patch similarity index 98% rename from vscode-paches/0038-feat-allow-to-switch-storage-service-workspace.patch rename to vscode-paches/0037-feat-allow-to-switch-storage-service-workspace.patch index 6a7e0a91..2ea089f6 100644 --- a/vscode-paches/0038-feat-allow-to-switch-storage-service-workspace.patch +++ b/vscode-paches/0037-feat-allow-to-switch-storage-service-workspace.patch @@ -8,7 +8,7 @@ Subject: [PATCH] feat: allow to switch storage service workspace 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 a77c2db9446..2b9a8c19926 100644 +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 { 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 new file mode 100644 index 00000000..3f5960c3 --- /dev/null +++ b/vscode-paches/0038-cleanup-remove-code-that-we-will-run-ourselves.patch @@ -0,0 +1,68 @@ +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 46172e06143..317aa021d22 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-cleanup-remove-code-that-we-will-run-ourselves.patch b/vscode-paches/0039-cleanup-remove-code-that-we-will-run-ourselves.patch deleted file mode 100644 index 6e0c78a3..00000000 --- a/vscode-paches/0039-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 5211f730099..c7ff3b53fab 100644 ---- a/src/vs/workbench/browser/workbench.ts -+++ b/src/vs/workbench/browser/workbench.ts -@@ -11,10 +11,7 @@ import { RunOnceScheduler, timeout } from 'vs/base/common/async'; - import { isFirefox, isSafari, isChrome } from 'vs/base/browser/browser'; - import { mark } from 'vs/base/common/performance'; - import { onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors'; --import { Registry } from 'vs/platform/registry/common/platform'; - import { isWindows, isLinux, isWeb, isNative, isMacintosh } from 'vs/base/common/platform'; --import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; --import { IEditorFactoryRegistry, EditorExtensions } from 'vs/workbench/common/editor'; - import { getSingletonServiceDescriptors } from 'vs/platform/instantiation/common/extensions'; - import { Position, Parts, IWorkbenchLayoutService, positionToString } from 'vs/workbench/services/layout/browser/layoutService'; - import { IStorageService, WillSaveStateReason, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; -@@ -35,7 +32,6 @@ import { FontMeasurements } from 'vs/editor/browser/config/fontMeasurements'; - import { BareFontInfo } from 'vs/editor/common/config/fontInfo'; - import { ILogService } from 'vs/platform/log/common/log'; - import { toErrorMessage } from 'vs/base/common/errorMessage'; --import { WorkbenchContextKeysHandler } from 'vs/workbench/browser/contextkeys'; - import { coalesce } from 'vs/base/common/arrays'; - import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; - import { Layout } from 'vs/workbench/browser/layout'; -@@ -43,9 +39,6 @@ import { IHostService } from 'vs/workbench/services/host/browser/host'; - import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; - import { mainWindow } from 'vs/base/browser/window'; - import { PixelRatio } from 'vs/base/browser/pixelRatio'; --import { IHoverService, WorkbenchHoverDelegate } from 'vs/platform/hover/browser/hover'; --import { setHoverDelegateFactory } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; --import { setBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2'; - import { AccessibilityProgressSignalScheduler } from 'vs/platform/accessibilitySignal/browser/progressAccessibilitySignalScheduler'; - import { setProgressAcccessibilitySignalScheduler } from 'vs/base/browser/ui/progressbar/progressAccessibilitySignal'; - import { AccessibleViewRegistry } from 'vs/platform/accessibility/browser/accessibleViewRegistry'; -@@ -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/0040-fix-typescript-use-import-function-able-to-replace-i.patch b/vscode-paches/0039-fix-typescript-use-import-function-able-to-replace-i.patch similarity index 100% rename from vscode-paches/0040-fix-typescript-use-import-function-able-to-replace-i.patch rename to vscode-paches/0039-fix-typescript-use-import-function-able-to-replace-i.patch diff --git a/vscode-paches/0041-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 similarity index 96% rename from vscode-paches/0041-feat-add-a-way-to-detect-if-localization-were-alread.patch rename to vscode-paches/0040-feat-add-a-way-to-detect-if-localization-were-alread.patch index 6775f631..1e11f5f8 100644 --- a/vscode-paches/0041-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 @@ -8,7 +8,7 @@ Subject: [PATCH] feat: add a way to detect if localization were already used 1 file changed, 7 insertions(+) diff --git a/src/vs/nls.ts b/src/vs/nls.ts -index 2e914738989..78ced4fe478 100644 +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 | diff --git a/vscode-paches/0042-fix-move-action-from-service-file-to-contribution.patch b/vscode-paches/0041-fix-move-action-from-service-file-to-contribution.patch similarity index 76% rename from vscode-paches/0042-fix-move-action-from-service-file-to-contribution.patch rename to vscode-paches/0041-fix-move-action-from-service-file-to-contribution.patch index 7d0d0dbc..2d5829c8 100644 --- a/vscode-paches/0042-fix-move-action-from-service-file-to-contribution.patch +++ b/vscode-paches/0041-fix-move-action-from-service-file-to-contribution.patch @@ -11,16 +11,16 @@ Subject: [PATCH] fix: move action from service file to contribution 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 f44d95e6694..ba7b881c0bb 100644 +index e5b58995fd2..8ef9e2becc0 100644 --- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts +++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts -@@ -31,6 +31,7 @@ import { StartupPageEditorResolverContribution, StartupPageRunnerContribution } - import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; - import { Categories } from 'vs/platform/action/common/actionCommonCategories'; - import { DisposableStore } from 'vs/base/common/lifecycle'; -+import 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService._contribution'; +@@ -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 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedIcons'; + 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 @@ -84,31 +84,31 @@ index 00000000000..3fc81fe28fc + } +}); diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.ts -index 28b50d2e885..8ca55d9f564 100644 +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 'vs/platform/instantiation/common/instantiation'; -+import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; - import { Emitter, Event } from 'vs/base/common/event'; - import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; - import { Memento } from 'vs/workbench/common/memento'; --import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; - import { ICommandService } from 'vs/platform/commands/common/commands'; - import { ContextKeyExpr, ContextKeyExpression, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; - import { Disposable } from 'vs/base/common/lifecycle'; -@@ -28,7 +27,7 @@ import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/ - import { dirname } from 'vs/base/common/path'; - import { coalesce } from 'vs/base/common/arrays'; - import { IViewsService } from 'vs/workbench/services/views/common/viewsService'; --import { localize, localize2 } from 'vs/nls'; -+import { localize } from 'vs/nls'; - import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; - import { checkGlobFileExists } from 'vs/workbench/services/extensions/common/workspaceContains'; - import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; +-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 } }; diff --git a/vscode-paches/0043-refactor-split-workbench-contribution.patch b/vscode-paches/0042-refactor-split-workbench-contribution.patch similarity index 61% rename from vscode-paches/0043-refactor-split-workbench-contribution.patch rename to vscode-paches/0042-refactor-split-workbench-contribution.patch index 9edc3189..4d16a13a 100644 --- a/vscode-paches/0043-refactor-split-workbench-contribution.patch +++ b/vscode-paches/0042-refactor-split-workbench-contribution.patch @@ -11,35 +11,35 @@ Subject: [PATCH] refactor: split workbench contribution .../themes/common/colorExtensionPoint.ts | 15 ++++++++++ .../themes/common/iconExtensionPoint.ts | 15 ++++++++++ .../tokenClassificationExtensionPoint.ts | 12 ++++++++ - src/vs/workbench/workbench.common.main.ts | 6 ++++ - 8 files changed, 93 insertions(+), 31 deletions(-) + 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 1d563ea1dce..2d9cfed9595 100644 +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 'vs/workbench/common/contributions'; --import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +-import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from '../../common/contributions.js'; +-import { IInstantiationService } from '../../../platform/instantiation/common/instantiation.js'; - -// --- other interested parties --import { JSONValidationExtensionPoint } from 'vs/workbench/api/common/jsonValidationExtensionPoint'; --import { ColorExtensionPoint } from 'vs/workbench/services/themes/common/colorExtensionPoint'; --import { IconExtensionPoint } from 'vs/workbench/services/themes/common/iconExtensionPoint'; --import { TokenClassificationExtensionPoints } from 'vs/workbench/services/themes/common/tokenClassificationExtensionPoint'; --import { LanguageConfigurationFileHandler } from 'vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint'; --import { StatusBarItemsExtensionPoint } from 'vs/workbench/api/browser/statusBarExtensionPoint'; +-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'; - import './mainThreadBulkEdits'; -@@ -88,22 +77,3 @@ import './mainThreadShare'; - import './mainThreadProfileContentHandlers'; - import './mainThreadAiRelatedInformation'; - import './mainThreadAiEmbeddingVector'; + 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 { - @@ -60,23 +60,23 @@ index 1d563ea1dce..2d9cfed9595 100644 - -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 b692381eaa2..9420ceebbf6 100644 +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 'vs/base/common/jsonSchema'; - import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; - import { localize } from 'vs/nls'; --import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -+import { IInstantiationService, createDecorator } from 'vs/platform/instantiation/common/instantiation'; - import { isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; - import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry'; - import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment, IStatusbarEntryAccessor, IStatusbarEntry, StatusbarAlignment, IStatusbarEntryPriority, StatusbarEntryKind } from 'vs/workbench/services/statusbar/browser/statusbar'; -@@ -22,6 +22,7 @@ import { Iterable } from 'vs/base/common/iterator'; - import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; - import { asStatusBarItemIdentifier } from 'vs/workbench/api/common/extHostTypes'; - import { STATUS_BAR_ERROR_ITEM_BACKGROUND, STATUS_BAR_WARNING_ITEM_BACKGROUND } from 'vs/workbench/common/theme'; -+import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; + 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 @@ -98,15 +98,15 @@ index b692381eaa2..9420ceebbf6 100644 + +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 1b82d305f19..aae5859f0b4 100644 +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 'vs/platform/extensions/common/extensions'; - import { Registry } from 'vs/platform/registry/common/platform'; - import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; - import { MarkdownString } from 'vs/base/common/htmlContent'; -+import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; -+import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +@@ -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[]; @@ -128,15 +128,15 @@ index 1b82d305f19..aae5859f0b4 100644 + +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 e3d1fcd1064..4b2c9641e2a 100644 +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 'vs/base/common/jsonErrorMessages'; - import { IExtensionResourceLoaderService } from 'vs/platform/extensionResourceLoader/common/extensionResourceLoader'; - import { hash } from 'vs/base/common/hash'; - import { Disposable } from 'vs/base/common/lifecycle'; -+import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; -+import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +@@ -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; @@ -158,15 +158,15 @@ index e3d1fcd1064..4b2c9641e2a 100644 + +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 235e0ed2948..1e7165b62f6 100644 +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 'vs/platform/instantiation/common/descriptors'; - import { IExtensionManifest } from 'vs/platform/extensions/common/extensions'; - import { MarkdownString } from 'vs/base/common/htmlContent'; -+import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -+import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; + 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; @@ -188,15 +188,15 @@ index 235e0ed2948..1e7165b62f6 100644 + +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 23becff8428..6bfef797984 100644 +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 'vs/base/common/themables'; - import * as resources from 'vs/base/common/resources'; - import { IExtensionDescription } from 'vs/platform/extensions/common/extensions'; - import { extname, posix } from 'vs/base/common/path'; -+import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -+import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; +@@ -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]: { @@ -218,15 +218,15 @@ index 23becff8428..6bfef797984 100644 + +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 49abd845677..33357dc7a36 100644 +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 'vs/nls'; - import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/workbench/services/extensions/common/extensionsRegistry'; - import { getTokenClassificationRegistry, ITokenClassificationRegistry, typeAndModifierIdPattern } from 'vs/platform/theme/common/tokenClassificationRegistry'; -+import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -+import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; + 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; @@ -247,19 +247,25 @@ index 49abd845677..33357dc7a36 100644 + +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 9e01f17536a..502d97c34d4 100644 +index 285fea2c50e..490e6ebae78 100644 --- a/src/vs/workbench/workbench.common.main.ts +++ b/src/vs/workbench/workbench.common.main.ts -@@ -35,6 +35,12 @@ import 'vs/workbench/browser/actions/widgetNavigationCommands'; - import 'vs/workbench/services/actions/common/menusExtensionPoint'; - import 'vs/workbench/api/common/configurationExtensionPoint'; - import 'vs/workbench/api/browser/viewsExtensionPoint'; -+import 'vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint'; -+import 'vs/workbench/api/common/jsonValidationExtensionPoint'; -+import 'vs/workbench/services/themes/common/colorExtensionPoint'; -+import 'vs/workbench/services/themes/common/iconExtensionPoint'; -+import 'vs/workbench/services/themes/common/tokenClassificationExtensionPoint'; -+import 'vs/workbench/api/browser/statusBarExtensionPoint'; +@@ -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/0044-refactor-split-service-and-extension-point.patch b/vscode-paches/0043-refactor-split-service-and-extension-point.patch similarity index 77% rename from vscode-paches/0044-refactor-split-service-and-extension-point.patch rename to vscode-paches/0043-refactor-split-service-and-extension-point.patch index 376af549..563c6406 100644 --- a/vscode-paches/0044-refactor-split-service-and-extension-point.patch +++ b/vscode-paches/0043-refactor-split-service-and-extension-point.patch @@ -5,57 +5,58 @@ Subject: [PATCH] refactor: split service and extension point --- .../api/browser/mainThreadStatusBar.ts | 2 +- - .../api/browser/statusBarExtensionPoint.ts | 165 +----------------- - .../workbench/api/browser/statusBarService.ts | 160 +++++++++++++++++ - 3 files changed, 167 insertions(+), 160 deletions(-) + .../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 00eb17f4982..6c8e54d035d 100644 +index 4988e519f39..d57f2ada2ba 100644 --- a/src/vs/workbench/api/browser/mainThreadStatusBar.ts +++ b/src/vs/workbench/api/browser/mainThreadStatusBar.ts -@@ -10,7 +10,7 @@ import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; - import { Command } from 'vs/editor/common/languages'; - import { IAccessibilityInformation } from 'vs/platform/accessibility/common/accessibility'; - import { IMarkdownString } from 'vs/base/common/htmlContent'; --import { IExtensionStatusBarItemService, StatusBarUpdateKind } from 'vs/workbench/api/browser/statusBarExtensionPoint'; -+import { IExtensionStatusBarItemService, StatusBarUpdateKind } from 'vs/workbench/api/browser/statusBarService'; - import { IStatusbarEntry, StatusbarAlignment } from 'vs/workbench/services/statusbar/browser/statusbar'; +@@ -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 9420ceebbf6..17826e3fef7 100644 +index 9e5c057b1fe..695a7c69617 100644 --- a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts +++ b/src/vs/workbench/api/browser/statusBarExtensionPoint.ts -@@ -3,171 +3,18 @@ - * Licensed under the MIT License. See License.txt in the project root for license information. +@@ -4,171 +4,19 @@ *--------------------------------------------------------------------------------------------*/ -+import { Iterable } from 'vs/base/common/iterator'; - import { IJSONSchema } from 'vs/base/common/jsonSchema'; --import { DisposableStore, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -+import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle'; - import { localize } from 'vs/nls'; --import { IInstantiationService, createDecorator } from 'vs/platform/instantiation/common/instantiation'; --import { isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; --import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry'; --import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment, IStatusbarEntryAccessor, IStatusbarEntry, StatusbarAlignment, IStatusbarEntryPriority, StatusbarEntryKind } from 'vs/workbench/services/statusbar/browser/statusbar'; --import { ThemeColor } from 'vs/base/common/themables'; --import { Command } from 'vs/editor/common/languages'; - import { IAccessibilityInformation, isAccessibilityInformation } from 'vs/platform/accessibility/common/accessibility'; --import { IMarkdownString } from 'vs/base/common/htmlContent'; --import { getCodiconAriaLabel } from 'vs/base/common/iconLabels'; --import { hash } from 'vs/base/common/hash'; --import { Event, Emitter } from 'vs/base/common/event'; --import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; --import { Iterable } from 'vs/base/common/iterator'; - import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; -+import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; - import { asStatusBarItemIdentifier } from 'vs/workbench/api/common/extHostTypes'; --import { STATUS_BAR_ERROR_ITEM_BACKGROUND, STATUS_BAR_WARNING_ITEM_BACKGROUND } from 'vs/workbench/common/theme'; - import { IWorkbenchContribution, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions'; -- -- + 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'); @@ -199,36 +200,33 @@ index 9420ceebbf6..17826e3fef7 100644 -registerSingleton(IExtensionStatusBarItemService, ExtensionStatusBarItemService, InstantiationType.Delayed); - -// --- extension point and reading of it -+import { isProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions'; -+import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry'; -+import { IExtensionStatusBarItemService, StatusBarUpdateKind } from './statusBarService'; - +- 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..eaaaa2b3cbe +index 00000000000..2dcf5005a86 --- /dev/null +++ b/src/vs/workbench/api/browser/statusBarService.ts -@@ -0,0 +1,160 @@ +@@ -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 { Emitter, Event } from 'vs/base/common/event'; -+import { hash } from 'vs/base/common/hash'; -+import { IMarkdownString } from 'vs/base/common/htmlContent'; -+import { getCodiconAriaLabel } from 'vs/base/common/iconLabels'; -+import { IDisposable, toDisposable } from 'vs/base/common/lifecycle'; -+import { ThemeColor } from 'vs/base/common/themables'; -+import { Command } from 'vs/editor/common/languages'; -+import { IAccessibilityInformation } from 'vs/platform/accessibility/common/accessibility'; -+import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; -+import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; -+import { STATUS_BAR_ERROR_ITEM_BACKGROUND, STATUS_BAR_WARNING_ITEM_BACKGROUND } from 'vs/workbench/common/theme'; -+import { IStatusbarEntry, IStatusbarEntryAccessor, IStatusbarEntryPriority, IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment, StatusbarAlignment, StatusbarEntryKind } from 'vs/workbench/services/statusbar/browser/statusbar'; -+ ++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 + diff --git a/vscode-paches/0045-fix-weird-syntax.patch b/vscode-paches/0044-fix-weird-syntax.patch similarity index 64% rename from vscode-paches/0045-fix-weird-syntax.patch rename to vscode-paches/0044-fix-weird-syntax.patch index 980a0752..ee85e1dc 100644 --- a/vscode-paches/0045-fix-weird-syntax.patch +++ b/vscode-paches/0044-fix-weird-syntax.patch @@ -8,16 +8,16 @@ Subject: [PATCH] fix: weird syntax 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 8506385b01c..3f6554ac9c0 100644 +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 'vs/base/common/actions'; - import { Event } from 'vs/base/common/event'; - import { IDisposable } from 'vs/base/common/lifecycle'; --import BaseSeverity from 'vs/base/common/severity'; -+import Severity from 'vs/base/common/severity'; - import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; + 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 { 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 new file mode 100644 index 00000000..2971e75c --- /dev/null +++ b/vscode-paches/0045-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch @@ -0,0 +1,104 @@ +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/0047-fix-change-syntax-that-language-service-refactor-doe.patch b/vscode-paches/0046-fix-change-syntax-that-language-service-refactor-doe.patch similarity index 86% rename from vscode-paches/0047-fix-change-syntax-that-language-service-refactor-doe.patch rename to vscode-paches/0046-fix-change-syntax-that-language-service-refactor-doe.patch index 83f80d93..889417b4 100644 --- a/vscode-paches/0047-fix-change-syntax-that-language-service-refactor-doe.patch +++ b/vscode-paches/0046-fix-change-syntax-that-language-service-refactor-doe.patch @@ -10,12 +10,12 @@ the re-exports source are removed during "Move to new file" refactor 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 dab0931a4c1..c8f3a8f30fe 100644 +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 'vs/workbe - import { IStringDictionary } from 'vs/base/common/collections'; - import { RawContextKey, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; +@@ -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'; diff --git a/vscode-paches/0046-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch b/vscode-paches/0046-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch deleted file mode 100644 index 6983ba87..00000000 --- a/vscode-paches/0046-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch +++ /dev/null @@ -1,54 +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 - ---- - src/vs/workbench/workbench.web.main.ts | 28 ++------------------------ - 1 file changed, 2 insertions(+), 26 deletions(-) - -diff --git a/src/vs/workbench/workbench.web.main.ts b/src/vs/workbench/workbench.web.main.ts -index e4a0a7e3e72..da0be08af02 100644 ---- a/src/vs/workbench/workbench.web.main.ts -+++ b/src/vs/workbench/workbench.web.main.ts -@@ -175,37 +175,13 @@ import 'vs/workbench/contrib/remote/browser/remoteStartEntry.contribution'; - // - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - --import { create, commands, env, window, workspace, logger } from 'vs/workbench/browser/web.factory'; --import { Menu } from 'vs/workbench/browser/web.api'; --import { URI } from 'vs/base/common/uri'; --import { Event, Emitter } from 'vs/base/common/event'; --import { Disposable } from 'vs/base/common/lifecycle'; --import { GroupOrientation } from 'vs/workbench/services/editor/common/editorGroupsService'; -+import { create } from 'vs/workbench/browser/web.factory'; - import { UserDataSyncResourceProviderService } from 'vs/platform/userDataSync/common/userDataSyncResourceProvider'; --import { RemoteAuthorityResolverError, RemoteAuthorityResolverErrorCode } from 'vs/platform/remote/common/remoteAuthorityResolver'; - - export { - - // Factory -- create, -- -- // Basic Types -- URI, -- Event, -- Emitter, -- Disposable, -- GroupOrientation, -- LogLevel, -- RemoteAuthorityResolverError, -- RemoteAuthorityResolverErrorCode, -- -- // Facade API -- env, -- window, -- workspace, -- commands, -- logger, -- Menu -+ create - }; - - //#endregion diff --git a/vscode-paches/0048-feat-add-build-tool-to-extract-service-identifiers.patch b/vscode-paches/0047-feat-add-build-tool-to-extract-service-identifiers.patch similarity index 100% rename from vscode-paches/0048-feat-add-build-tool-to-extract-service-identifiers.patch rename to vscode-paches/0047-feat-add-build-tool-to-extract-service-identifiers.patch diff --git a/vscode-paches/0049-fix-fix-editor-css.patch b/vscode-paches/0048-fix-fix-editor-css.patch similarity index 100% rename from vscode-paches/0049-fix-fix-editor-css.patch rename to vscode-paches/0048-fix-fix-editor-css.patch diff --git a/vscode-paches/0050-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 similarity index 91% rename from vscode-paches/0050-refactor-split-code-to-be-able-to-import-only-requir.patch rename to vscode-paches/0049-refactor-split-code-to-be-able-to-import-only-requir.patch index 70f7e05b..428364e7 100644 --- a/vscode-paches/0050-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 @@ -4,13 +4,35 @@ 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 ++- - 3 files changed, 236 insertions(+), 207 deletions(-) + 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 7d4c51d21bb..20758125c70 100644 +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 { @@ -338,12 +360,12 @@ index 7d4c51d21bb..20758125c70 100644 interface IExtensionCacheData { diff --git a/src/vs/platform/files/common/fileService.ts b/src/vs/platform/files/common/fileService.ts -index b353968540e..55977ded402 100644 +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 'vs/platform/files/common/io'; - import { ILogService } from 'vs/platform/log/common/log'; - import { ErrorNoTelemetry } from 'vs/base/common/errors'; +@@ -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 { @@ -475,10 +497,10 @@ index b353968540e..55977ded402 100644 //#endregion diff --git a/src/vs/workbench/services/localization/browser/localeService.ts b/src/vs/workbench/services/localization/browser/localeService.ts -index c77edccfe58..9d048b43b1f 100644 +index 63082ed6952..a107a2f8695 100644 --- a/src/vs/workbench/services/localization/browser/localeService.ts +++ b/src/vs/workbench/services/localization/browser/localeService.ts -@@ -74,8 +74,7 @@ const localeStorage = new class LocaleStorage { +@@ -51,8 +51,7 @@ const localeStorage = new class LocaleStorage { } }; @@ -488,7 +510,7 @@ index c77edccfe58..9d048b43b1f 100644 declare readonly _serviceBrand: undefined; constructor( -@@ -84,20 +83,15 @@ export class WebLocaleService implements ILocaleService { +@@ -61,20 +60,15 @@ export class WebLocaleService implements ILocaleService { @IProductService private readonly productService: IProductService ) { } @@ -513,7 +535,7 @@ index c77edccfe58..9d048b43b1f 100644 const restartDialog = await this.dialogService.confirm({ type: 'info', -@@ -112,8 +106,7 @@ export class WebLocaleService implements ILocaleService { +@@ -89,8 +83,7 @@ export class WebLocaleService implements ILocaleService { } async clearLocalePreference(): Promise { @@ -523,7 +545,7 @@ index c77edccfe58..9d048b43b1f 100644 if (Language.value() === navigator.language.toLowerCase()) { return; -@@ -132,6 +125,25 @@ export class WebLocaleService implements ILocaleService { +@@ -109,6 +102,25 @@ export class WebLocaleService implements ILocaleService { } } 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 new file mode 100644 index 00000000..5d86cc91 --- /dev/null +++ b/vscode-paches/0050-fix-rollback-typescript-as-the-last-version-breaks-t.patch @@ -0,0 +1,63 @@ +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 a849e69a098..88d0ca5061b 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 51fb981850e..446627d4f3a 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/0052-fix-just-use-regular-dynamic-import.patch b/vscode-paches/0051-fix-just-use-regular-dynamic-import.patch similarity index 75% rename from vscode-paches/0052-fix-just-use-regular-dynamic-import.patch rename to vscode-paches/0051-fix-just-use-regular-dynamic-import.patch index c21a38f0..2cae0ff0 100644 --- a/vscode-paches/0052-fix-just-use-regular-dynamic-import.patch +++ b/vscode-paches/0051-fix-just-use-regular-dynamic-import.patch @@ -8,18 +8,18 @@ Subject: [PATCH] fix: just use regular dynamic import 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 7f529f4a661..667e56edc89 100644 +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 'vs/nls'; - import { Emitter, Event } from 'vs/base/common/event'; --import { isESM } from 'vs/base/common/amd'; --import { AppResourcePath, FileAccess } from 'vs/base/common/network'; - import { Disposable } from 'vs/base/common/lifecycle'; - import { KeymapInfo, IRawMixedKeyboardMapping, IKeymapInfo } from 'vs/workbench/services/keybinding/common/keymapInfo'; - import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions'; + 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'; diff --git a/vscode-paches/0051-fix-rollback-typescript-as-the-last-version-breaks-t.patch b/vscode-paches/0051-fix-rollback-typescript-as-the-last-version-breaks-t.patch deleted file mode 100644 index e3a22e11..00000000 --- a/vscode-paches/0051-fix-rollback-typescript-as-the-last-version-breaks-t.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: Fri, 2 Aug 2024 14:20:58 +0200 -Subject: [PATCH] fix: rollback typescript as the last version breaks the - extractServices script - ---- - package.json | 2 +- - src/vs/base/parts/request/browser/request.ts | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/package.json b/package.json -index 13fc4f4cabe..78c5bf13c55 100644 ---- a/package.json -+++ b/package.json -@@ -215,7 +215,7 @@ - "ts-node": "^10.9.1", - "tsec": "0.2.7", - "tslib": "^2.6.3", -- "typescript": "^5.7.0-dev.20240826", -+ "typescript": "5.5.0-dev.20240408", - "util": "^0.12.4", - "vscode-nls-dev": "^3.3.1", - "webpack": "^5.91.0", -diff --git a/src/vs/base/parts/request/browser/request.ts b/src/vs/base/parts/request/browser/request.ts -index 7e40f2d80f5..d7cef790158 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/0052-fix-fix-treeshaking-script.patch b/vscode-paches/0052-fix-fix-treeshaking-script.patch new file mode 100644 index 00000000..c0da3f63 --- /dev/null +++ b/vscode-paches/0052-fix-fix-treeshaking-script.patch @@ -0,0 +1,34 @@ +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/0053-fix-fix-build.patch b/vscode-paches/0053-fix-fix-build.patch new file mode 100644 index 00000000..c044649b --- /dev/null +++ b/vscode-paches/0053-fix-fix-build.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= +Date: Sun, 6 Oct 2024 16:58:18 +0200 +Subject: [PATCH] fix: fix build + +--- + src/vs/workbench/api/node/extHostExtensionService.ts | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/vs/workbench/api/node/extHostExtensionService.ts b/src/vs/workbench/api/node/extHostExtensionService.ts +index 51e767f1fdc..f96e3b57486 100644 +--- a/src/vs/workbench/api/node/extHostExtensionService.ts ++++ b/src/vs/workbench/api/node/extHostExtensionService.ts +@@ -46,7 +46,6 @@ class NodeModuleRequireInterceptor extends RequireInterceptor { + return originalLookup.call(this, applyAlternatives(request), parent); + }; + +- // ESM-uncomment-begin + const originalResolveFilename = node_module._resolveFilename; + node_module._resolveFilename = function resolveFilename(request: string, parent: unknown, isMain: boolean, options?: { paths?: string[] }) { + if (request === 'vsda' && Array.isArray(options?.paths) && options.paths.length === 0) { +@@ -58,7 +57,6 @@ class NodeModuleRequireInterceptor extends RequireInterceptor { + } + return originalResolveFilename.call(this, request, parent, isMain, options); + }; +- // ESM-uncomment-end + + const applyAlternatives = (request: string) => { + for (const alternativeModuleName of that._alternatives) { 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 new file mode 100644 index 00000000..50f11fcc --- /dev/null +++ b/vscode-paches/0054-fix-make-editor-types-build-until-it-s-fixed-by-MS.patch @@ -0,0 +1,55 @@ +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 + ) + ); From 4460d21cd4fdfb99748baec6dfebd2771127e273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 7 Oct 2024 15:58:19 +0200 Subject: [PATCH 2/7] fix: fix import-meta-asset-plugin resolution see https://github.com/modernweb-dev/web/pull/2819 --- ...llup-plugin-import-meta-assets+2.2.1.patch | 25 +++++++++++++++++++ rollup/rollup.config.ts | 10 +++----- 2 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 patches/@web+rollup-plugin-import-meta-assets+2.2.1.patch diff --git a/patches/@web+rollup-plugin-import-meta-assets+2.2.1.patch b/patches/@web+rollup-plugin-import-meta-assets+2.2.1.patch new file mode 100644 index 00000000..47dbe7e8 --- /dev/null +++ b/patches/@web+rollup-plugin-import-meta-assets+2.2.1.patch @@ -0,0 +1,25 @@ +diff --git a/node_modules/@web/rollup-plugin-import-meta-assets/src/rollup-plugin-import-meta-assets.js b/node_modules/@web/rollup-plugin-import-meta-assets/src/rollup-plugin-import-meta-assets.js +index 245ec98..d623ef3 100644 +--- a/node_modules/@web/rollup-plugin-import-meta-assets/src/rollup-plugin-import-meta-assets.js ++++ b/node_modules/@web/rollup-plugin-import-meta-assets/src/rollup-plugin-import-meta-assets.js +@@ -161,11 +161,19 @@ ${` default: return new Promise(function(resolve, reject) { + if (importMetaUrlType === 'static') { + const absoluteScriptDir = path.dirname(id); + const relativeAssetPath = getRelativeAssetPath(node); ++ const resolved = await this.resolve(relativeAssetPath, id) ++ if (resolved == null) { ++ this.error(`Unable to resolve "${relativeAssetPath}" from "${id}"`) ++ return ++ } ++ if (resolved.external) { ++ return ++ } + const absoluteAssetPath = path.resolve(absoluteScriptDir, relativeAssetPath); + const assetName = path.basename(absoluteAssetPath); + + try { +- const assetContents = await fs.promises.readFile(absoluteAssetPath); ++ const assetContents = await fs.promises.readFile(resolved.id); + const transformedAssetContents = + transform != null + ? await transform(assetContents, absoluteAssetPath) diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index 82f44d97..7ef15dca 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -436,9 +436,7 @@ export default (args: Record): rollup.RollupOptions[] => { input, plugins: [ importMetaAssets({ - include: ['**/*.ts', '**/*.js'], - // assets are externals and this plugin is not able to ignore external assets - exclude: ['**/service-override/textmate.ts', '**/service-override/languageDetectionWorker.ts'] + include: ['**/*.ts', '**/*.js'] }), commonjs({ include: '**/vscode-semver/**/*' @@ -621,9 +619,8 @@ export default (args: Record): rollup.RollupOptions[] => { hoistTransitiveImports: false }], plugins: [importMetaAssets({ - include: ['**/*.ts', '**/*.js'], + include: ['**/*.ts', '**/*.js'] // assets are externals and this plugin is not able to ignore external assets - exclude: ['**/service-override/textmate.js', '**/service-override/languageDetectionWorker.js'] }), { name: 'resolve-asset-url', resolveFileUrl (options) { @@ -1068,9 +1065,8 @@ export default (args: Record): rollup.RollupOptions[] => { treeshake: false, plugins: [ importMetaAssets({ - include: ['**/*.ts', '**/*.js'], + include: ['**/*.ts', '**/*.js'] // assets are externals and this plugin is not able to ignore external assets - exclude: ['**/service-override/textmate.js', '**/service-override/languageDetectionWorker.js'] }), nodeResolve({ extensions: EXTENSIONS From 753cd022523ed73ef6aacd9c29e3d6257d9f82b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 7 Oct 2024 15:59:48 +0200 Subject: [PATCH 3/7] feat: support new treesitter syntax highlighting --- .ncurc.json | 1 + package-lock.json | 6 ++++++ rollup/rollup.config.ts | 9 ++++++++- scripts/install-vscode | 2 +- src/service-override/treesitter.ts | 21 +++++++++++++++++++++ 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 src/service-override/treesitter.ts diff --git a/.ncurc.json b/.ncurc.json index 9edd6d4d..c2e6582a 100644 --- a/.ncurc.json +++ b/.ncurc.json @@ -10,6 +10,7 @@ "@vscode/proxy-agent", "@vscode/ripgrep", "@vscode/spdlog", + "@vscode/tree-sitter-wasm", "@vscode/vscode-languagedetection", "@vscode/windows-process-tree", "@vscode/windows-registry", diff --git a/package-lock.json b/package-lock.json index e6bf0ba3..7fceed12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@vscode/proxy-agent": "^0.22.0", "@vscode/ripgrep": "^1.15.9", "@vscode/spdlog": "^0.15.0", + "@vscode/tree-sitter-wasm": "^0.0.4", "@vscode/vscode-languagedetection": "1.0.21", "@vscode/windows-process-tree": "^0.6.0", "@vscode/windows-registry": "^1.1.0", @@ -3878,6 +3879,11 @@ "node": "^16 || ^18 || >= 20" } }, + "node_modules/@vscode/tree-sitter-wasm": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@vscode/tree-sitter-wasm/-/tree-sitter-wasm-0.0.4.tgz", + "integrity": "sha512-vOONG3Zxsh1I4JOA48WdQ5KiXjJAdfMvYTuHbW7b27tGtRqsPLY5WZyTwLXc5uujKHyhG3LJXE9poxRZSxTIiA==" + }, "node_modules/@vscode/vscode-languagedetection": { "version": "1.0.21", "resolved": "https://registry.npmjs.org/@vscode/vscode-languagedetection/-/vscode-languagedetection-1.0.21.tgz", diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index 7ef15dca..bf5c34cb 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -581,7 +581,14 @@ export default (args: Record): rollup.RollupOptions[] => { }), { name: 'dynamic-import-polyfill', - renderDynamicImport (): { left: string, right: string } { + renderDynamicImport ({ targetModuleId }): { left: string, right: string } { + // Hack for @vscode/tree-sitter-wasm that doesn't export its parser correctly (as default instead of a named export, in commonjs) + if (targetModuleId === '@vscode/tree-sitter-wasm') { + return { + left: 'import(', + right: ').then(module => ({ Parser: module.default ?? module }))' + } + } // dynamic imports of vscode-oniguruma and vscode-textmate aren't working without it on vite return { left: 'import(', diff --git a/scripts/install-vscode b/scripts/install-vscode index 1205fedf..fbde98fa 100755 --- a/scripts/install-vscode +++ b/scripts/install-vscode @@ -91,7 +91,7 @@ mkdir -p $output_directory echo "Building vscode..." NODE_OPTIONS=--max-old-space-size=8192 npx tsc --declaration --importHelpers --module es2020 --preserveConstEnums --outDir "$output_directory/src" --rootDir . # Copy files that are already built and assets -find ./ \( -name '*.js' -o -name '*.d.ts' -o -name '*.ttf' -o -name '*.css' -o -name '*.mp3' -o -name '*.svg' -o -name '*.png' -o -name '*.html' -o -name '*.sh' -o -name '*.zsh' -o -name '*.ps1' \) -exec rsync -R \{\} "$output_directory/src" \; +find ./ \( -name '*.js' -o -name '*.d.ts' -o -name '*.ttf' -o -name '*.css' -o -name '*.mp3' -o -name '*.scm' -o -name '*.svg' -o -name '*.png' -o -name '*.html' -o -name '*.sh' -o -name '*.zsh' -o -name '*.ps1' \) -exec rsync -R \{\} "$output_directory/src" \; cd .. cp package.json $output_directory diff --git a/src/service-override/treesitter.ts b/src/service-override/treesitter.ts new file mode 100644 index 00000000..5ee92f83 --- /dev/null +++ b/src/service-override/treesitter.ts @@ -0,0 +1,21 @@ +import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { ITreeSitterParserService } from 'vs/editor/common/services/treeSitterParserService' +import { TreeSitterTextModelService } from 'vs/editor/browser/services/treeSitter/treeSitterParserService' +import { ITreeSitterTokenizationFeature } from 'vs/workbench/services/treeSitter/browser/treeSitterTokenizationFeature.service' +import { TreeSitterTokenizationFeature } from 'vs/workbench/services/treeSitter/browser/treeSitterTokenizationFeature' +import { registerAssets } from '../assets' +import 'vs/workbench/services/treeSitter/browser/treeSitterTokenizationFeature.contribution' + +registerAssets({ + 'vs/../../node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter.wasm': new URL('@vscode/tree-sitter-wasm/wasm/tree-sitter.wasm', import.meta.url).href, + 'vs/../../node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-typescript.wasm': new URL('@vscode/tree-sitter-wasm/wasm/tree-sitter-typescript.wasm', import.meta.url).href, + 'vs/editor/common/languages/highlights/typescript.scm': new URL('../../vscode/src/vs/editor/common/languages/highlights/typescript.scm', import.meta.url).href +}) + +export default function getServiceOverride (): IEditorOverrideServices { + return { + [ITreeSitterParserService.toString()]: new SyncDescriptor(TreeSitterTextModelService, [], false), + [ITreeSitterTokenizationFeature.toString()]: new SyncDescriptor(TreeSitterTokenizationFeature, [], false) + } +} From b3ac17a12dd1cfd492a996d88aa79d92277b022b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 7 Oct 2024 16:04:09 +0200 Subject: [PATCH 4/7] feat(demo): install and demo treesitter --- demo/package-lock.json | 199 ++++++++++++++++--------------- demo/package.json | 1 + demo/src/setup.common.ts | 2 + demo/src/user/configuration.json | 3 +- 4 files changed, 111 insertions(+), 94 deletions(-) diff --git a/demo/package-lock.json b/demo/package-lock.json index 4499e85f..952e92e1 100644 --- a/demo/package-lock.json +++ b/demo/package-lock.json @@ -148,6 +148,7 @@ "@codingame/monaco-vscode-theme-solarized-light-default-extension": "file:../dist/default-extension-theme-solarized-light", "@codingame/monaco-vscode-theme-tomorrow-night-blue-default-extension": "file:../dist/default-extension-theme-tomorrow-night-blue", "@codingame/monaco-vscode-timeline-service-override": "file:../dist/service-override-timeline", + "@codingame/monaco-vscode-treesitter-service-override": "file:../dist/service-override-treesitter", "@codingame/monaco-vscode-typescript-basics-default-extension": "file:../dist/default-extension-typescript-basics", "@codingame/monaco-vscode-typescript-language-features-default-extension": "file:../dist/default-extension-typescript-language-features", "@codingame/monaco-vscode-update-service-override": "file:../dist/service-override-update", @@ -823,6 +824,13 @@ "@codingame/monaco-vscode-layout-service-override": "0.0.0-semantic-release", "@codingame/monaco-vscode-quickaccess-service-override": "0.0.0-semantic-release", "@vscode/iconv-lite-umd": "0.7.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/xterm": "^5.6.0-beta.64", "jschardet": "3.1.3", "marked": "~14.0.0" } @@ -833,9 +841,9 @@ "dev": true, "license": "MIT", "dependencies": { - "@rollup/pluginutils": "^5.1.0", + "@rollup/pluginutils": "^5.1.2", "css-url-parser": "^1.1.4", - "memfs": "^4.11.1", + "memfs": "^4.12.0", "mime-types": "^2.1.35", "yauzl": "^3.0.0" } @@ -1248,13 +1256,6 @@ "version": "0.0.0-semantic-release", "license": "MIT", "dependencies": { - "@xterm/addon-clipboard": "0.2.0-beta.39", - "@xterm/addon-image": "0.9.0-beta.56", - "@xterm/addon-search": "0.16.0-beta.56", - "@xterm/addon-serialize": "0.14.0-beta.56", - "@xterm/addon-unicode11": "0.9.0-beta.56", - "@xterm/addon-webgl": "0.19.0-beta.56", - "@xterm/xterm": "5.6.0-beta.56", "vscode": "npm:@codingame/monaco-vscode-api@^0.0.0-semantic-release" } }, @@ -1295,12 +1296,20 @@ "vscode": "npm:@codingame/monaco-vscode-api@^0.0.0-semantic-release" } }, + "../dist/service-override-treesitter": { + "name": "@codingame/monaco-vscode-treesitter-service-override", + "version": "0.0.0-semantic-release", + "license": "MIT", + "dependencies": { + "@vscode/tree-sitter-wasm": "^0.0.4", + "vscode": "npm:@codingame/monaco-vscode-api@^0.0.0-semantic-release" + } + }, "../dist/service-override-update": { "name": "@codingame/monaco-vscode-update-service-override", "version": "0.0.0-semantic-release", "license": "MIT", "dependencies": { - "marked": "~14.0.0", "vscode": "npm:@codingame/monaco-vscode-api@^0.0.0-semantic-release" } }, @@ -2104,6 +2113,10 @@ "resolved": "../dist/service-override-timeline", "link": true }, + "node_modules/@codingame/monaco-vscode-treesitter-service-override": { + "resolved": "../dist/service-override-treesitter", + "link": true + }, "node_modules/@codingame/monaco-vscode-typescript-basics-default-extension": { "resolved": "../dist/default-extension-typescript-basics", "link": true @@ -2582,9 +2595,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.3.tgz", - "integrity": "sha512-MmKSfaB9GX+zXl6E8z4koOr/xU63AMVleLEa64v7R0QF/ZloMs5vcD1sHgM64GXXS1csaJutG+ddtzcueI/BLg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.0.tgz", + "integrity": "sha512-Q6HJd7Y6xdB48x8ZNVDOqsbh2uByBhgK8PiQgPhwkIw/HC/YX5Ghq2mQY5sRMZWHb3VsFkWooUVOZHKr7DmDIA==", "cpu": [ "arm" ], @@ -2595,9 +2608,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.3.tgz", - "integrity": "sha512-zrt8ecH07PE3sB4jPOggweBjJMzI1JG5xI2DIsUbkA+7K+Gkjys6eV7i9pOenNSDJH3eOr/jLb/PzqtmdwDq5g==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.0.tgz", + "integrity": "sha512-ijLnS1qFId8xhKjT81uBHuuJp2lU4x2yxa4ctFPtG+MqEE6+C5f/+X/bStmxapgmwLwiL3ih122xv8kVARNAZA==", "cpu": [ "arm64" ], @@ -2608,9 +2621,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.3.tgz", - "integrity": "sha512-P0UxIOrKNBFTQaXTxOH4RxuEBVCgEA5UTNV6Yz7z9QHnUJ7eLX9reOd/NYMO3+XZO2cco19mXTxDMXxit4R/eQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.0.tgz", + "integrity": "sha512-bIv+X9xeSs1XCk6DVvkO+S/z8/2AMt/2lMqdQbMrmVpgFvXlmde9mLcbQpztXm1tajC3raFDqegsH18HQPMYtA==", "cpu": [ "arm64" ], @@ -2621,9 +2634,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.3.tgz", - "integrity": "sha512-L1M0vKGO5ASKntqtsFEjTq/fD91vAqnzeaF6sfNAy55aD+Hi2pBI5DKwCO+UNDQHWsDViJLqshxOahXyLSh3EA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.0.tgz", + "integrity": "sha512-X6/nOwoFN7RT2svEQWUsW/5C/fYMBe4fnLK9DQk4SX4mgVBiTA9h64kjUYPvGQ0F/9xwJ5U5UfTbl6BEjaQdBQ==", "cpu": [ "x64" ], @@ -2634,9 +2647,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.3.tgz", - "integrity": "sha512-btVgIsCjuYFKUjopPoWiDqmoUXQDiW2A4C3Mtmp5vACm7/GnyuprqIDPNczeyR5W8rTXEbkmrJux7cJmD99D2g==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.0.tgz", + "integrity": "sha512-0KXvIJQMOImLCVCz9uvvdPgfyWo93aHHp8ui3FrtOP57svqrF/roSSR5pjqL2hcMp0ljeGlU4q9o/rQaAQ3AYA==", "cpu": [ "arm" ], @@ -2647,9 +2660,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.3.tgz", - "integrity": "sha512-zmjbSphplZlau6ZTkxd3+NMtE4UKVy7U4aVFMmHcgO5CUbw17ZP6QCgyxhzGaU/wFFdTfiojjbLG3/0p9HhAqA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.0.tgz", + "integrity": "sha512-it2BW6kKFVh8xk/BnHfakEeoLPv8STIISekpoF+nBgWM4d55CZKc7T4Dx1pEbTnYm/xEKMgy1MNtYuoA8RFIWw==", "cpu": [ "arm" ], @@ -2660,9 +2673,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.3.tgz", - "integrity": "sha512-nSZfcZtAnQPRZmUkUQwZq2OjQciR6tEoJaZVFvLHsj0MF6QhNMg0fQ6mUOsiCUpTqxTx0/O6gX0V/nYc7LrgPw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.0.tgz", + "integrity": "sha512-i0xTLXjqap2eRfulFVlSnM5dEbTVque/3Pi4g2y7cxrs7+a9De42z4XxKLYJ7+OhE3IgxvfQM7vQc43bwTgPwA==", "cpu": [ "arm64" ], @@ -2673,9 +2686,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.3.tgz", - "integrity": "sha512-MnvSPGO8KJXIMGlQDYfvYS3IosFN2rKsvxRpPO2l2cum+Z3exiExLwVU+GExL96pn8IP+GdH8Tz70EpBhO0sIQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.0.tgz", + "integrity": "sha512-9E6MKUJhDuDh604Qco5yP/3qn3y7SLXYuiC0Rpr89aMScS2UAmK1wHP2b7KAa1nSjWJc/f/Lc0Wl1L47qjiyQw==", "cpu": [ "arm64" ], @@ -2686,9 +2699,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.3.tgz", - "integrity": "sha512-+W+p/9QNDr2vE2AXU0qIy0qQE75E8RTwTwgqS2G5CRQ11vzq0tbnfBd6brWhS9bCRjAjepJe2fvvkvS3dno+iw==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.0.tgz", + "integrity": "sha512-2XFFPJ2XMEiF5Zi2EBf4h73oR1V/lycirxZxHZNc93SqDN/IWhYYSYj8I9381ikUFXZrz2v7r2tOVk2NBwxrWw==", "cpu": [ "ppc64" ], @@ -2699,9 +2712,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.3.tgz", - "integrity": "sha512-yXH6K6KfqGXaxHrtr+Uoy+JpNlUlI46BKVyonGiaD74ravdnF9BUNC+vV+SIuB96hUMGShhKV693rF9QDfO6nQ==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.0.tgz", + "integrity": "sha512-M3Dg4hlwuntUCdzU7KjYqbbd+BLq3JMAOhCKdBE3TcMGMZbKkDdJ5ivNdehOssMCIokNHFOsv7DO4rlEOfyKpg==", "cpu": [ "riscv64" ], @@ -2712,9 +2725,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.3.tgz", - "integrity": "sha512-R8cwY9wcnApN/KDYWTH4gV/ypvy9yZUHlbJvfaiXSB48JO3KpwSpjOGqO4jnGkLDSk1hgjYkTbTt6Q7uvPf8eg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.0.tgz", + "integrity": "sha512-mjBaoo4ocxJppTorZVKWFpy1bfFj9FeCMJqzlMQGjpNPY9JwQi7OuS1axzNIk0nMX6jSgy6ZURDZ2w0QW6D56g==", "cpu": [ "s390x" ], @@ -2725,9 +2738,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.3.tgz", - "integrity": "sha512-kZPbX/NOPh0vhS5sI+dR8L1bU2cSO9FgxwM8r7wHzGydzfSjLRCFAT87GR5U9scj2rhzN3JPYVC7NoBbl4FZ0g==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.0.tgz", + "integrity": "sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==", "cpu": [ "x64" ], @@ -2738,9 +2751,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.3.tgz", - "integrity": "sha512-S0Yq+xA1VEH66uiMNhijsWAafffydd2X5b77eLHfRmfLsRSpbiAWiRHV6DEpz6aOToPsgid7TI9rGd6zB1rhbg==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.0.tgz", + "integrity": "sha512-w1i+L7kAXZNdYl+vFvzSZy8Y1arS7vMgIy8wusXJzRrPyof5LAb02KGr1PD2EkRcl73kHulIID0M501lN+vobQ==", "cpu": [ "x64" ], @@ -2751,9 +2764,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.3.tgz", - "integrity": "sha512-9isNzeL34yquCPyerog+IMCNxKR8XYmGd0tHSV+OVx0TmE0aJOo9uw4fZfUuk2qxobP5sug6vNdZR6u7Mw7Q+Q==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.0.tgz", + "integrity": "sha512-VXBrnPWgBpVDCVY6XF3LEW0pOU51KbaHhccHw6AS6vBWIC60eqsH19DAeeObl+g8nKAz04QFdl/Cefta0xQtUQ==", "cpu": [ "arm64" ], @@ -2764,9 +2777,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.3.tgz", - "integrity": "sha512-nMIdKnfZfzn1Vsk+RuOvl43ONTZXoAPUUxgcU0tXooqg4YrAqzfKzVenqqk2g5efWh46/D28cKFrOzDSW28gTA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.0.tgz", + "integrity": "sha512-xrNcGDU0OxVcPTH/8n/ShH4UevZxKIO6HJFK0e15XItZP2UcaiLFd5kiX7hJnqCbSztUF8Qot+JWBC/QXRPYWQ==", "cpu": [ "ia32" ], @@ -2777,9 +2790,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.3.tgz", - "integrity": "sha512-fOvu7PCQjAj4eWDEuD8Xz5gpzFqXzGlxHZozHP4b9Jxv9APtdxL6STqztDzMLuRXEc4UpXGGhx029Xgm91QBeA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.0.tgz", + "integrity": "sha512-fbMkAF7fufku0N2dE5TBXcNlg0pt0cJue4xBRE2Qc5Vqikxr4VCgKj/ht6SMdFcOacVA9rqF70APJ8RN/4vMJw==", "cpu": [ "x64" ], @@ -2854,9 +2867,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, "node_modules/@types/express": { @@ -2872,9 +2885,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.19.5", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", - "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", + "version": "4.19.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", + "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", "dev": true, "dependencies": { "@types/node": "*", @@ -2896,9 +2909,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.16.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.5.tgz", - "integrity": "sha512-VwYCweNo3ERajwy0IUlqqcyZ8/A7Zwa9ZP3MnENWcB11AejO+tLy3pu850goUW2FC/IJMdZUfKpX/yxL1gymCA==", + "version": "20.16.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.10.tgz", + "integrity": "sha512-vQUKgWTjEIRFCvK6CyriPH3MZYiYlNy0fKiEYHWbcoWLEgs4opurGGKlebrTLqdSMIbXImH6XExNiIyNUv3WpA==", "dev": true, "dependencies": { "undici-types": "~6.19.2" @@ -2947,9 +2960,9 @@ } }, "node_modules/@types/ssh2/node_modules/@types/node": { - "version": "18.19.50", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.50.tgz", - "integrity": "sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==", + "version": "18.19.54", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.54.tgz", + "integrity": "sha512-+BRgt0G5gYjTvdLac9sIeE0iZcJxi4Jc4PV5EUzqi+88jmQLr+fRZdv2tCTV7IHKSGxM6SaLoOXQWWUiLUItMw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -3925,12 +3938,12 @@ } }, "node_modules/rollup": { - "version": "4.21.3", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.3.tgz", - "integrity": "sha512-7sqRtBNnEbcBtMeRVc6VRsJMmpI+JU1z9VTvW8D4gXIYQFz0aLcsE6rRkyghZkLfEgUZgVvOG7A5CVz/VW5GIA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.0.tgz", + "integrity": "sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==", "dev": true, "dependencies": { - "@types/estree": "1.0.5" + "@types/estree": "1.0.6" }, "bin": { "rollup": "dist/bin/rollup" @@ -3940,22 +3953,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.21.3", - "@rollup/rollup-android-arm64": "4.21.3", - "@rollup/rollup-darwin-arm64": "4.21.3", - "@rollup/rollup-darwin-x64": "4.21.3", - "@rollup/rollup-linux-arm-gnueabihf": "4.21.3", - "@rollup/rollup-linux-arm-musleabihf": "4.21.3", - "@rollup/rollup-linux-arm64-gnu": "4.21.3", - "@rollup/rollup-linux-arm64-musl": "4.21.3", - "@rollup/rollup-linux-powerpc64le-gnu": "4.21.3", - "@rollup/rollup-linux-riscv64-gnu": "4.21.3", - "@rollup/rollup-linux-s390x-gnu": "4.21.3", - "@rollup/rollup-linux-x64-gnu": "4.21.3", - "@rollup/rollup-linux-x64-musl": "4.21.3", - "@rollup/rollup-win32-arm64-msvc": "4.21.3", - "@rollup/rollup-win32-ia32-msvc": "4.21.3", - "@rollup/rollup-win32-x64-msvc": "4.21.3", + "@rollup/rollup-android-arm-eabi": "4.24.0", + "@rollup/rollup-android-arm64": "4.24.0", + "@rollup/rollup-darwin-arm64": "4.24.0", + "@rollup/rollup-darwin-x64": "4.24.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.24.0", + "@rollup/rollup-linux-arm-musleabihf": "4.24.0", + "@rollup/rollup-linux-arm64-gnu": "4.24.0", + "@rollup/rollup-linux-arm64-musl": "4.24.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.24.0", + "@rollup/rollup-linux-riscv64-gnu": "4.24.0", + "@rollup/rollup-linux-s390x-gnu": "4.24.0", + "@rollup/rollup-linux-x64-gnu": "4.24.0", + "@rollup/rollup-linux-x64-musl": "4.24.0", + "@rollup/rollup-win32-arm64-msvc": "4.24.0", + "@rollup/rollup-win32-ia32-msvc": "4.24.0", + "@rollup/rollup-win32-x64-msvc": "4.24.0", "fsevents": "~2.3.2" } }, @@ -4275,9 +4288,9 @@ } }, "node_modules/vite": { - "version": "5.4.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.6.tgz", - "integrity": "sha512-IeL5f8OO5nylsgzd9tq4qD2QqI0k2CQLGrWD0rCN0EQJZpBK5vJAx0I+GDkMOXxQX/OfFHMuLIx6ddAxGX/k+Q==", + "version": "5.4.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", + "integrity": "sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==", "dev": true, "dependencies": { "esbuild": "^0.21.3", diff --git a/demo/package.json b/demo/package.json index f9c06120..d4211bda 100644 --- a/demo/package.json +++ b/demo/package.json @@ -185,6 +185,7 @@ "@codingame/monaco-vscode-xml-default-extension": "file:../dist/default-extension-xml", "@codingame/monaco-vscode-yaml-default-extension": "file:../dist/default-extension-yaml", "@codingame/monaco-vscode-view-common-service-override": "file:../dist/service-override-view-common", + "@codingame/monaco-vscode-treesitter-service-override": "file:../dist/service-override-treesitter", "ansi-colors": "^4.1.3", "dockerode": "^4.0.2", "express": "^4.21.0", diff --git a/demo/src/setup.common.ts b/demo/src/setup.common.ts index 35e4136f..1f4c1bb8 100644 --- a/demo/src/setup.common.ts +++ b/demo/src/setup.common.ts @@ -59,6 +59,7 @@ import getSurveyServiceOverride from '@codingame/monaco-vscode-survey-service-ov import getUpdateServiceOverride from '@codingame/monaco-vscode-update-service-override' import getExplorerServiceOverride from '@codingame/monaco-vscode-explorer-service-override' import getLocalizationServiceOverride from '@codingame/monaco-vscode-localization-service-override' +import getTreeSitterServiceOverride from '@codingame/monaco-vscode-treesitter-service-override' import { EnvironmentOverride } from 'vscode/workbench' import { Worker } from './tools/crossOriginWorker' import defaultKeybindings from './user/keybindings.json?raw' @@ -302,6 +303,7 @@ export const commonServices: IEditorOverrideServices = { ...getConfigurationServiceOverride(), ...getKeybindingsServiceOverride(), ...getTextmateServiceOverride(), + ...getTreeSitterServiceOverride(), ...getThemeServiceOverride(), ...getLanguagesServiceOverride(), ...getDebugServiceOverride(), diff --git a/demo/src/user/configuration.json b/demo/src/user/configuration.json index fcce34de..dd18c53b 100644 --- a/demo/src/user/configuration.json +++ b/demo/src/user/configuration.json @@ -22,5 +22,6 @@ "editor.experimental.asyncTokenization": true, "terminal.integrated.tabs.title": "${sequence}", "typescript.tsserver.log": "normal", - "workbench.sideBar.location": "left" + "workbench.sideBar.location": "left", + "editor.experimental.preferTreeSitter": ["typescript"] } \ No newline at end of file From 769d53401e81ea9dcaf70eb9a3fdbbf911b199df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 7 Oct 2024 18:37:42 +0200 Subject: [PATCH 5/7] chore: switch to prettier --- .eslintrc | 2 +- .prettierrc.cjs | 7 +++++++ demo/.eslintrc | 2 +- monaco-vscode-api.code-workspace | 12 +++++++++++- package-lock.json | 29 +++++++++++++++++++++++++++++ package.json | 2 ++ 6 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 .prettierrc.cjs diff --git a/.eslintrc b/.eslintrc index a4ba2491..21bad89d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -13,7 +13,7 @@ "VSCODE_COMMIT": "readonly" }, "extends": [ - "@codingame" + "@codingame/eslint-config", "prettier" ], "rules": { "import/extensions": [ diff --git a/.prettierrc.cjs b/.prettierrc.cjs new file mode 100644 index 00000000..7ce9123d --- /dev/null +++ b/.prettierrc.cjs @@ -0,0 +1,7 @@ +module.exports = { + singleQuote: true, + jsxSingleQuote: true, + trailingComma: 'none', + semi: false, + printWidth: 100 +} diff --git a/demo/.eslintrc b/demo/.eslintrc index 817edf58..96b70dfd 100644 --- a/demo/.eslintrc +++ b/demo/.eslintrc @@ -7,7 +7,7 @@ "project": "./tsconfig.json" }, "extends": [ - "@codingame" + "@codingame/eslint-config", "prettier" ], "rules": { "import/extensions": ["off"], diff --git a/monaco-vscode-api.code-workspace b/monaco-vscode-api.code-workspace index 9f41f427..3a6e359a 100644 --- a/monaco-vscode-api.code-workspace +++ b/monaco-vscode-api.code-workspace @@ -7,5 +7,15 @@ "path": "demo" } ], - "settings": {} + "settings": { + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "search.exclude": { + "**/dist": true, + "**/node_modules": true, + "**/*.code-search": true + } + } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7fceed12..172e8db2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,6 +73,7 @@ "@web/rollup-plugin-import-meta-assets": "^2.2.1", "change-package-name": "^1.0.5", "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-n": "^17.8.0", @@ -85,6 +86,7 @@ "param-case": "^3.0.4", "pascal-case": "^3.1.2", "patch-package": "^8.0.0", + "prettier": "^3.3.3", "recast": "^0.23.9", "rollup": "^4.24.0", "rollup-plugin-copy": "^3.5.0", @@ -6026,6 +6028,18 @@ "eslint": ">=6.0.0" } }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-config-standard": { "version": "17.1.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.1.0.tgz", @@ -12683,6 +12697,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-ms": { "version": "9.1.0", "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-9.1.0.tgz", diff --git a/package.json b/package.json index 62d5aab6..5f632534 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "@web/rollup-plugin-import-meta-assets": "^2.2.1", "change-package-name": "^1.0.5", "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-n": "^17.8.0", @@ -81,6 +82,7 @@ "param-case": "^3.0.4", "pascal-case": "^3.1.2", "patch-package": "^8.0.0", + "prettier": "^3.3.3", "recast": "^0.23.9", "rollup": "^4.24.0", "rollup-plugin-copy": "^3.5.0", From 63567639c3d94792da920d67552d980341a54be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 7 Oct 2024 18:38:11 +0200 Subject: [PATCH 6/7] chore: format all files --- commitlint.config.cjs | 4 +- demo/src/debugServer.ts | 147 +- demo/src/features/ai.ts | 54 +- demo/src/features/customView.views.ts | 155 +- demo/src/features/customView.workbench.ts | 155 +- demo/src/features/debugger.ts | 80 +- demo/src/features/editor.ts | 35 +- demo/src/features/intellisense.ts | 75 +- demo/src/features/notifications.ts | 37 +- demo/src/features/output.ts | 27 +- demo/src/features/scm.ts | 69 +- demo/src/features/search.ts | 54 +- demo/src/features/terminal.ts | 17 +- demo/src/features/testing.ts | 141 +- demo/src/loader.ts | 56 +- demo/src/main.common.ts | 37 +- demo/src/main.views.ts | 44 +- demo/src/setup.common.ts | 333 +- demo/src/setup.views.ts | 102 +- demo/src/setup.workbench.ts | 72 +- demo/src/tools/crossOriginWorker.ts | 2 +- demo/src/tools/extHostWorker.ts | 4 +- demo/src/tools/fakeWorker.ts | 6 +- demo/src/types.d.ts | 2 +- demo/vite.config.ts | 18 +- demo/vite.netlify.config.ts | 4 +- release.ts | 68 +- rollup/rollup-metadata-plugin.ts | 97 +- rollup/rollup.config.ts | 1747 +++-- rollup/rollup.default-extensions.ts | 331 +- rollup/rollup.language-packs.ts | 223 +- rollup/rollup.monaco.ts | 170 +- rollup/rollup.rollup-plugins.config.ts | 50 +- rollup/rollup.types.config.ts | 634 +- src/assets.ts | 2 +- src/editor.api.ts | 18 +- src/extension-tools.ts | 195 +- src/extension.api.ts | 29 +- src/extensions.ts | 140 +- src/l10n.ts | 19 +- src/lifecycle.ts | 65 +- src/localExtensionHost.ts | 127 +- src/missing-services.ts | 6549 ++++++++++------- src/monaco.ts | 320 +- .../browser/parts/editor/textEditor.js | 2 +- .../browser/parts/editor/textEditor.weak.js | 4 +- src/rollup-extension-directory-plugin.ts | 65 +- src/rollup-vsix-plugin.ts | 99 +- src/service-override/accessibility.ts | 14 +- src/service-override/ai.ts | 14 +- src/service-override/authentication.ts | 25 +- src/service-override/base.ts | 5 +- src/service-override/bulkEdit.ts | 2 +- src/service-override/chat.ts | 44 +- src/service-override/comments.ts | 2 +- src/service-override/configuration.ts | 171 +- src/service-override/debug.ts | 13 +- src/service-override/dialogs.ts | 8 +- src/service-override/editSessions.ts | 19 +- src/service-override/editor.ts | 56 +- src/service-override/emmet.ts | 5 +- src/service-override/environment.ts | 27 +- src/service-override/explorer.ts | 2 +- src/service-override/extensionGallery.ts | 145 +- src/service-override/extensions.ts | 194 +- src/service-override/files.ts | 708 +- src/service-override/host.ts | 8 +- src/service-override/interactive.ts | 14 +- src/service-override/issue.ts | 7 +- src/service-override/keybindings.ts | 89 +- .../languageDetectionWorker.ts | 12 +- src/service-override/languages.ts | 2 +- src/service-override/layout.ts | 258 +- src/service-override/lifecycle.ts | 2 +- src/service-override/localization.ts | 25 +- src/service-override/log.ts | 29 +- src/service-override/markers.ts | 5 +- src/service-override/model.ts | 2 +- src/service-override/monarch.ts | 5 +- src/service-override/multiDiffEditor.ts | 8 +- src/service-override/notebook.ts | 49 +- src/service-override/notifications.ts | 14 +- src/service-override/outline.ts | 2 +- src/service-override/output.ts | 6 +- src/service-override/performance.ts | 5 +- src/service-override/preferences.ts | 2 +- src/service-override/quickaccess.ts | 117 +- src/service-override/relauncher.ts | 5 +- src/service-override/remoteAgent.ts | 73 +- src/service-override/scm.ts | 2 +- src/service-override/search.ts | 24 +- src/service-override/secretStorage.ts | 2 +- src/service-override/share.ts | 2 +- src/service-override/snippets.ts | 22 +- src/service-override/speech.ts | 2 +- src/service-override/storage.ts | 195 +- src/service-override/survey.ts | 5 +- src/service-override/task.ts | 2 +- src/service-override/terminal.ts | 105 +- src/service-override/testing.ts | 8 +- src/service-override/textmate.ts | 28 +- src/service-override/theme.ts | 27 +- src/service-override/timeline.ts | 2 +- src/service-override/tools/editor.ts | 413 +- src/service-override/tools/url.ts | 2 +- src/service-override/tools/views.ts | 399 +- src/service-override/treesitter.ts | 29 +- src/service-override/update.ts | 2 +- src/service-override/userDataProfile.ts | 139 +- src/service-override/userDataSync.ts | 60 +- src/service-override/viewBanner.ts | 8 +- src/service-override/viewCommon.ts | 44 +- src/service-override/viewStatusBar.ts | 13 +- src/service-override/viewTitleBar.ts | 4 +- src/service-override/views.ts | 591 +- src/service-override/walkthrough.ts | 2 +- src/service-override/welcome.ts | 5 +- src/service-override/workbench.ts | 21 +- src/service-override/workingCopy.ts | 27 +- src/service-override/workspaceTrust.ts | 22 +- src/services.ts | 127 +- src/tools.ts | 28 +- src/tools/injection.ts | 37 +- src/workbench.ts | 30 +- 124 files changed, 10716 insertions(+), 6590 deletions(-) diff --git a/commitlint.config.cjs b/commitlint.config.cjs index 03a951b8..80a4d650 100644 --- a/commitlint.config.cjs +++ b/commitlint.config.cjs @@ -1,3 +1,3 @@ module.exports = { - extends: ['@codingame/commitlint-config-codingame'] -}; + extends: ['@codingame/commitlint-config-codingame'] +} diff --git a/demo/src/debugServer.ts b/demo/src/debugServer.ts index fa757e95..5ae896be 100644 --- a/demo/src/debugServer.ts +++ b/demo/src/debugServer.ts @@ -9,10 +9,10 @@ import * as stream from 'stream' const docker = new Docker() const image = 'ghcr.io/graalvm/graalvm-ce:21.2.0' -async function createContainer () { +async function createContainer() { const stream = await docker.pull(image) await new Promise((resolve, reject) => { - docker.modem.followProgress(stream, err => err == null ? resolve() : reject(err)) + docker.modem.followProgress(stream, (err) => (err == null ? resolve() : reject(err))) }) await fs.promises.mkdir('/tmp/workspace', { recursive: true @@ -23,18 +23,20 @@ async function createContainer () { Entrypoint: ['sleep', 'infinity'], HostConfig: { NetworkMode: 'host', - Mounts: [{ - Type: 'bind', - Target: '/workspace', - Source: '/tmp/workspace' - }], + Mounts: [ + { + Type: 'bind', + Target: '/workspace', + Source: '/tmp/workspace' + } + ], AutoRemove: true } }) return container } -async function prepareContainer (container: Docker.Container) { +async function prepareContainer(container: Docker.Container) { await container.start() // eslint-disable-next-line no-console console.log('Installing node') @@ -47,7 +49,7 @@ async function prepareContainer (container: Docker.Container) { hijack: true }) execStream.pipe(process.stdout) - await new Promise(resolve => execStream.on('end', resolve)) + await new Promise((resolve) => execStream.on('end', resolve)) // eslint-disable-next-line no-console console.log('Node installed') } @@ -56,7 +58,7 @@ async function prepareContainer (container: Docker.Container) { console.log('Pulling image/starting container...') const containerPromise = createContainer() -async function exitHandler () { +async function exitHandler() { // eslint-disable-next-line no-console console.log('Exiting...') try { @@ -83,7 +85,7 @@ class DAPSocket { private socket: net.Socket private rawData = Buffer.allocUnsafe(0) private contentLength = -1 - constructor (private onMessage: (message: string) => void) { + constructor(private onMessage: (message: string) => void) { this.socket = new net.Socket() this.socket.on('data', this.onData) } @@ -121,12 +123,15 @@ class DAPSocket { } } - public connect (port: number) { + public connect(port: number) { this.socket.connect(port) } - public sendMessage (message: string) { - this.socket.write(`Content-Length: ${Buffer.byteLength(message, 'utf8')}${TWO_CRLF}${message}`, 'utf8') + public sendMessage(message: string) { + this.socket.write( + `Content-Length: ${Buffer.byteLength(message, 'utf8')}${TWO_CRLF}${message}`, + 'utf8' + ) } } @@ -141,8 +146,8 @@ const server = http.createServer(app) const wss = new WebSocketServer({ server }) -async function findPortFree () { - return await new Promise(resolve => { +async function findPortFree() { + return await new Promise((resolve) => { const srv = net.createServer() srv.listen(0, () => { const port = (srv.address() as net.AddressInfo).port @@ -151,71 +156,87 @@ async function findPortFree () { }) } -function sequential (fn: (...params: P) => Promise): (...params: P) => Promise { +function sequential( + fn: (...params: P) => Promise +): (...params: P) => Promise { let promise = Promise.resolve() return (...params: P) => { const result = promise.then(() => { return fn(...params) }) - promise = result.then(() => {}, () => {}) + promise = result.then( + () => {}, + () => {} + ) return result } } wss.on('connection', (ws) => { - const socket = new DAPSocket(message => ws.send(message)) + const socket = new DAPSocket((message) => ws.send(message)) let initialized = false - ws.on('message', sequential(async (message: string) => { - if (!initialized) { - try { - initialized = true - const init: { main: string, files: Record } = JSON.parse(message) - for (const [file, content] of Object.entries(init.files)) { - await fs.promises.writeFile('/tmp/' + file, content) - } - const debuggerPort = await findPortFree() - const exec = await container.exec({ - Cmd: ['node', `--dap=${debuggerPort}`, '--dap.WaitAttached', '--dap.Suspend=false', `${init.main}`], - AttachStdout: true, - AttachStderr: true - }) - - const execStream = await exec.start({ - hijack: true - }) - const stdout = new stream.PassThrough() - const stderr = new stream.PassThrough() - container.modem.demuxStream(execStream, stdout, stderr) - function sendOutput (category: 'stdout' | 'stderr', output: Buffer) { - ws.send(JSON.stringify({ - type: 'event', - event: 'output', - body: { - category, - output: output.toString() - } - })) - } - stdout.on('data', sendOutput.bind(undefined, 'stdout')) - stderr.on('data', sendOutput.bind(undefined, 'stderr')) + ws.on( + 'message', + sequential(async (message: string) => { + if (!initialized) { + try { + initialized = true + const init: { main: string; files: Record } = JSON.parse(message) + for (const [file, content] of Object.entries(init.files)) { + await fs.promises.writeFile('/tmp/' + file, content) + } + const debuggerPort = await findPortFree() + const exec = await container.exec({ + Cmd: [ + 'node', + `--dap=${debuggerPort}`, + '--dap.WaitAttached', + '--dap.Suspend=false', + `${init.main}` + ], + AttachStdout: true, + AttachStderr: true + }) + + const execStream = await exec.start({ + hijack: true + }) + const stdout = new stream.PassThrough() + const stderr = new stream.PassThrough() + container.modem.demuxStream(execStream, stdout, stderr) + function sendOutput(category: 'stdout' | 'stderr', output: Buffer) { + ws.send( + JSON.stringify({ + type: 'event', + event: 'output', + body: { + category, + output: output.toString() + } + }) + ) + } + stdout.on('data', sendOutput.bind(undefined, 'stdout')) + stderr.on('data', sendOutput.bind(undefined, 'stderr')) - execStream.on('end', () => { - ws.close() - }) + execStream.on('end', () => { + ws.close() + }) - await new Promise(resolve => setTimeout(resolve, 1000)) - socket.connect(debuggerPort) + await new Promise((resolve) => setTimeout(resolve, 1000)) + socket.connect(debuggerPort) - return - } catch (err) { - console.error('Failed to initialize', err) + return + } catch (err) { + console.error('Failed to initialize', err) + } } - } - socket.sendMessage(message) - })) + socket.sendMessage(message) + }) + ) }) server.listen(PORT, () => { diff --git a/demo/src/features/ai.ts b/demo/src/features/ai.ts index d8f8ec8d..4d129a7a 100644 --- a/demo/src/features/ai.ts +++ b/demo/src/features/ai.ts @@ -1,24 +1,30 @@ import { ExtensionHostKind, registerExtension } from 'vscode/extensions' -const { getApi } = registerExtension({ - name: 'aiDemo', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' +const { getApi } = registerExtension( + { + name: 'aiDemo', + publisher: 'codingame', + version: '1.0.0', + engines: { + vscode: '*' + }, + contributes: { + commands: [ + { + command: 'aiSuggestedCommand', + title: 'This is a command suggested by the AI' + } + ] + }, + enabledApiProposals: ['aiRelatedInformation'] }, - contributes: { - commands: [{ - command: 'aiSuggestedCommand', - title: 'This is a command suggested by the AI' - }] - }, - enabledApiProposals: ['aiRelatedInformation'] -}, ExtensionHostKind.LocalProcess, { - system: true // to be able to use api proposals -}) + ExtensionHostKind.LocalProcess, + { + system: true // to be able to use api proposals + } +) -void getApi().then(async vscode => { +void getApi().then(async (vscode) => { vscode.commands.registerCommand('aiSuggestedCommand', () => { void vscode.window.showInformationMessage('Hello', { detail: 'You just run the AI suggested command', @@ -26,12 +32,14 @@ void getApi().then(async vscode => { }) }) vscode.ai.registerRelatedInformationProvider(vscode.RelatedInformationType.CommandInformation, { - provideRelatedInformation () { - return [{ - type: vscode.RelatedInformationType.CommandInformation, - command: 'aiSuggestedCommand', - weight: 9999 - }] + provideRelatedInformation() { + return [ + { + type: vscode.RelatedInformationType.CommandInformation, + command: 'aiSuggestedCommand', + weight: 9999 + } + ] } }) }) diff --git a/demo/src/features/customView.views.ts b/demo/src/features/customView.views.ts index 88586d05..c49224fb 100644 --- a/demo/src/features/customView.views.ts +++ b/demo/src/features/customView.views.ts @@ -1,5 +1,23 @@ -import { IDialogService, EditorInput, createInstance, IInstantiationService, IEditorGroup } from 'vscode/services' -import { IEditorCloseHandler, IEditorSerializer, registerCustomView, registerEditorPane, registerEditor, registerEditorSerializer, ViewContainerLocation, SimpleEditorPane, SimpleEditorInput, RegisteredEditorPriority, ConfirmResult } from '@codingame/monaco-vscode-views-service-override' +import { + IDialogService, + EditorInput, + createInstance, + IInstantiationService, + IEditorGroup +} from 'vscode/services' +import { + IEditorCloseHandler, + IEditorSerializer, + registerCustomView, + registerEditorPane, + registerEditor, + registerEditorSerializer, + ViewContainerLocation, + SimpleEditorPane, + SimpleEditorInput, + RegisteredEditorPriority, + ConfirmResult +} from '@codingame/monaco-vscode-views-service-override' import * as monaco from 'monaco-editor' registerCustomView({ @@ -14,42 +32,44 @@ registerCustomView({ container.innerHTML = 'This is a custom view
You can render anything you want here' return { - dispose () { - } + dispose() {} } }, location: ViewContainerLocation.Panel, icon: new URL('../Visual_Studio_Code_1.35_icon.svg', import.meta.url).toString(), - actions: [{ - id: 'custom-action', - title: 'Custom action', - render (element) { - const button = document.createElement('button') - button.innerText = 'Ugly button' - button.style.height = '30px' - button.onclick = () => { - alert('What did you expect?') + actions: [ + { + id: 'custom-action', + title: 'Custom action', + render(element) { + const button = document.createElement('button') + button.innerText = 'Ugly button' + button.style.height = '30px' + button.onclick = () => { + alert('What did you expect?') + } + element.append(button) + } + }, + { + id: 'custom-action2', + title: 'Custom action2', + icon: 'dialogInfo', + async run(accessor) { + void accessor.get(IDialogService).info('This is a custom view action button') } - element.append(button) - } - }, { - id: 'custom-action2', - title: 'Custom action2', - icon: 'dialogInfo', - async run (accessor) { - void accessor.get(IDialogService).info('This is a custom view action button') } - }] + ] }) class CustomEditorPane extends SimpleEditorPane { static readonly ID = 'workbench.editors.customEditor' - constructor (group: IEditorGroup) { + constructor(group: IEditorGroup) { super(CustomEditorPane.ID, group) } - initialize (): HTMLElement { + initialize(): HTMLElement { const container = document.createElement('div') container.style.display = 'flex' container.style.alignItems = 'center' @@ -58,21 +78,24 @@ class CustomEditorPane extends SimpleEditorPane { return container } - async renderInput (input: EditorInput): Promise { + async renderInput(input: EditorInput): Promise { if (input.resource != null) { this.container.innerHTML = 'Opened file: ' + input.resource.path } else { - this.container.innerHTML = 'This is a custom editor pane
You can render anything you want here' + this.container.innerHTML = + 'This is a custom editor pane
You can render anything you want here' } return { - dispose () { - } + dispose() {} } } } class CustomEditorInput extends SimpleEditorInput implements IEditorCloseHandler { - constructor (resource: monaco.Uri | undefined, @IDialogService private dialogService: IDialogService) { + constructor( + resource: monaco.Uri | undefined, + @IDialogService private dialogService: IDialogService + ) { super(resource) this.closeHandler = this @@ -80,58 +103,74 @@ class CustomEditorInput extends SimpleEditorInput implements IEditorCloseHandler this.setName('Custom editor pane input') } - async confirm (): Promise { + async confirm(): Promise { const { confirmed } = await this.dialogService.confirm({ message: 'Are you sure you want to close this INCREDIBLE editor pane?' }) return confirmed ? ConfirmResult.DONT_SAVE : ConfirmResult.CANCEL } - showConfirm (): boolean { + showConfirm(): boolean { return true } - get typeId (): string { + get typeId(): string { return CustomEditorPane.ID } } -registerEditorPane('custom-editor-pane', 'Custom editor pane', CustomEditorPane, [CustomEditorInput]) +registerEditorPane('custom-editor-pane', 'Custom editor pane', CustomEditorPane, [ + CustomEditorInput +]) -registerEditor('*.customeditor', { - id: CustomEditorPane.ID, - label: 'Custom editor pane input', - priority: RegisteredEditorPriority.default -}, { - singlePerResource: true -}, { - async createEditorInput (editorInput) { - return { - editor: await createInstance(CustomEditorInput, editorInput.resource) +registerEditor( + '*.customeditor', + { + id: CustomEditorPane.ID, + label: 'Custom editor pane input', + priority: RegisteredEditorPriority.default + }, + { + singlePerResource: true + }, + { + async createEditorInput(editorInput) { + return { + editor: await createInstance(CustomEditorInput, editorInput.resource) + } } } -}) +) interface ISerializedCustomEditorInput { resourceJSON?: monaco.UriComponents } -registerEditorSerializer(CustomEditorPane.ID, class implements IEditorSerializer { - canSerialize (): boolean { - return true - } - - serialize (editor: CustomEditorInput): string | undefined { - const serializedFileEditorInput: ISerializedCustomEditorInput = { - resourceJSON: editor.resource?.toJSON() +registerEditorSerializer( + CustomEditorPane.ID, + class implements IEditorSerializer { + canSerialize(): boolean { + return true } - return JSON.stringify(serializedFileEditorInput) - } + serialize(editor: CustomEditorInput): string | undefined { + const serializedFileEditorInput: ISerializedCustomEditorInput = { + resourceJSON: editor.resource?.toJSON() + } - deserialize (instantiationService: IInstantiationService, serializedEditor: string): EditorInput | undefined { - const serializedFileEditorInput: ISerializedCustomEditorInput = JSON.parse(serializedEditor) - return instantiationService.createInstance(CustomEditorInput, monaco.Uri.revive(serializedFileEditorInput.resourceJSON)) + return JSON.stringify(serializedFileEditorInput) + } + + deserialize( + instantiationService: IInstantiationService, + serializedEditor: string + ): EditorInput | undefined { + const serializedFileEditorInput: ISerializedCustomEditorInput = JSON.parse(serializedEditor) + return instantiationService.createInstance( + CustomEditorInput, + monaco.Uri.revive(serializedFileEditorInput.resourceJSON) + ) + } } -}) +) export { CustomEditorInput } diff --git a/demo/src/features/customView.workbench.ts b/demo/src/features/customView.workbench.ts index 4bdc7d3a..9cab95b2 100644 --- a/demo/src/features/customView.workbench.ts +++ b/demo/src/features/customView.workbench.ts @@ -1,5 +1,23 @@ -import { IDialogService, EditorInput, createInstance, IInstantiationService, IEditorGroup } from 'vscode/services' -import { IEditorCloseHandler, IEditorSerializer, registerCustomView, registerEditorPane, registerEditor, registerEditorSerializer, ViewContainerLocation, SimpleEditorPane, SimpleEditorInput, RegisteredEditorPriority, ConfirmResult } from '@codingame/monaco-vscode-workbench-service-override' +import { + IDialogService, + EditorInput, + createInstance, + IInstantiationService, + IEditorGroup +} from 'vscode/services' +import { + IEditorCloseHandler, + IEditorSerializer, + registerCustomView, + registerEditorPane, + registerEditor, + registerEditorSerializer, + ViewContainerLocation, + SimpleEditorPane, + SimpleEditorInput, + RegisteredEditorPriority, + ConfirmResult +} from '@codingame/monaco-vscode-workbench-service-override' import * as monaco from 'monaco-editor' registerCustomView({ @@ -14,42 +32,44 @@ registerCustomView({ container.innerHTML = 'This is a custom view
You can render anything you want here' return { - dispose () { - } + dispose() {} } }, location: ViewContainerLocation.Panel, icon: new URL('../Visual_Studio_Code_1.35_icon.svg', import.meta.url).toString(), - actions: [{ - id: 'custom-action', - title: 'Custom action', - render (element) { - const button = document.createElement('button') - button.innerText = 'Ugly button' - button.style.height = '30px' - button.onclick = () => { - alert('What did you expect?') + actions: [ + { + id: 'custom-action', + title: 'Custom action', + render(element) { + const button = document.createElement('button') + button.innerText = 'Ugly button' + button.style.height = '30px' + button.onclick = () => { + alert('What did you expect?') + } + element.append(button) + } + }, + { + id: 'custom-action2', + title: 'Custom action2', + icon: 'dialogInfo', + async run(accessor) { + void accessor.get(IDialogService).info('This is a custom view action button') } - element.append(button) - } - }, { - id: 'custom-action2', - title: 'Custom action2', - icon: 'dialogInfo', - async run (accessor) { - void accessor.get(IDialogService).info('This is a custom view action button') } - }] + ] }) class CustomEditorPane extends SimpleEditorPane { static readonly ID = 'workbench.editors.customEditor' - constructor (group: IEditorGroup) { + constructor(group: IEditorGroup) { super(CustomEditorPane.ID, group) } - initialize (): HTMLElement { + initialize(): HTMLElement { const container = document.createElement('div') container.style.display = 'flex' container.style.alignItems = 'center' @@ -58,21 +78,24 @@ class CustomEditorPane extends SimpleEditorPane { return container } - async renderInput (input: EditorInput): Promise { + async renderInput(input: EditorInput): Promise { if (input.resource != null) { this.container.innerHTML = 'Opened file: ' + input.resource.path } else { - this.container.innerHTML = 'This is a custom editor pane
You can render anything you want here' + this.container.innerHTML = + 'This is a custom editor pane
You can render anything you want here' } return { - dispose () { - } + dispose() {} } } } class CustomEditorInput extends SimpleEditorInput implements IEditorCloseHandler { - constructor (resource: monaco.Uri | undefined, @IDialogService private dialogService: IDialogService) { + constructor( + resource: monaco.Uri | undefined, + @IDialogService private dialogService: IDialogService + ) { super(resource) this.closeHandler = this @@ -80,58 +103,74 @@ class CustomEditorInput extends SimpleEditorInput implements IEditorCloseHandler this.setName('Custom editor pane input') } - async confirm (): Promise { + async confirm(): Promise { const { confirmed } = await this.dialogService.confirm({ message: 'Are you sure you want to close this INCREDIBLE editor pane?' }) return confirmed ? ConfirmResult.DONT_SAVE : ConfirmResult.CANCEL } - showConfirm (): boolean { + showConfirm(): boolean { return true } - get typeId (): string { + get typeId(): string { return CustomEditorPane.ID } } -registerEditorPane('custom-editor-pane', 'Custom editor pane', CustomEditorPane, [CustomEditorInput]) +registerEditorPane('custom-editor-pane', 'Custom editor pane', CustomEditorPane, [ + CustomEditorInput +]) -registerEditor('*.customeditor', { - id: CustomEditorPane.ID, - label: 'Custom editor pane input', - priority: RegisteredEditorPriority.default -}, { - singlePerResource: true -}, { - async createEditorInput (editorInput) { - return { - editor: await createInstance(CustomEditorInput, editorInput.resource) +registerEditor( + '*.customeditor', + { + id: CustomEditorPane.ID, + label: 'Custom editor pane input', + priority: RegisteredEditorPriority.default + }, + { + singlePerResource: true + }, + { + async createEditorInput(editorInput) { + return { + editor: await createInstance(CustomEditorInput, editorInput.resource) + } } } -}) +) interface ISerializedCustomEditorInput { resourceJSON?: monaco.UriComponents } -registerEditorSerializer(CustomEditorPane.ID, class implements IEditorSerializer { - canSerialize (): boolean { - return true - } - - serialize (editor: CustomEditorInput): string | undefined { - const serializedFileEditorInput: ISerializedCustomEditorInput = { - resourceJSON: editor.resource?.toJSON() +registerEditorSerializer( + CustomEditorPane.ID, + class implements IEditorSerializer { + canSerialize(): boolean { + return true } - return JSON.stringify(serializedFileEditorInput) - } + serialize(editor: CustomEditorInput): string | undefined { + const serializedFileEditorInput: ISerializedCustomEditorInput = { + resourceJSON: editor.resource?.toJSON() + } - deserialize (instantiationService: IInstantiationService, serializedEditor: string): EditorInput | undefined { - const serializedFileEditorInput: ISerializedCustomEditorInput = JSON.parse(serializedEditor) - return instantiationService.createInstance(CustomEditorInput, monaco.Uri.revive(serializedFileEditorInput.resourceJSON)) + return JSON.stringify(serializedFileEditorInput) + } + + deserialize( + instantiationService: IInstantiationService, + serializedEditor: string + ): EditorInput | undefined { + const serializedFileEditorInput: ISerializedCustomEditorInput = JSON.parse(serializedEditor) + return instantiationService.createInstance( + CustomEditorInput, + monaco.Uri.revive(serializedFileEditorInput.resourceJSON) + ) + } } -}) +) export { CustomEditorInput } diff --git a/demo/src/features/debugger.ts b/demo/src/features/debugger.ts index 8dc26ca2..f59b9346 100644 --- a/demo/src/features/debugger.ts +++ b/demo/src/features/debugger.ts @@ -1,32 +1,39 @@ import { ExtensionHostKind, registerExtension } from 'vscode/extensions' import type * as vscode from 'vscode' -const { getApi, registerFileUrl } = registerExtension({ - name: 'debugger', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' +const { getApi, registerFileUrl } = registerExtension( + { + name: 'debugger', + publisher: 'codingame', + version: '1.0.0', + engines: { + vscode: '*' + }, + // A browser field is mandatory for the extension to be flagged as `web` + browser: 'extension.js', + contributes: { + debuggers: [ + { + type: 'javascript', + label: 'Test', + languages: ['javascript'] + } + ], + breakpoints: [ + { + language: 'javascript' + } + ] + } }, - // A browser field is mandatory for the extension to be flagged as `web` - browser: 'extension.js', - contributes: { - debuggers: [{ - type: 'javascript', - label: 'Test', - languages: ['javascript'] - }], - breakpoints: [{ - language: 'javascript' - }] - } -}, ExtensionHostKind.LocalProcess) + ExtensionHostKind.LocalProcess +) registerFileUrl('./extension.js', 'data:text/javascript;base64,' + window.btoa('// nothing')) -void getApi().then(async debuggerVscodeApi => { +void getApi().then(async (debuggerVscodeApi) => { class WebsocketDebugAdapter implements vscode.DebugAdapter { - constructor (private websocket: WebSocket) { + constructor(private websocket: WebSocket) { websocket.onmessage = (message) => { this._onDidSendMessage.fire(JSON.parse(message.data)) } @@ -35,17 +42,17 @@ void getApi().then(async debuggerVscodeApi => { _onDidSendMessage = new debuggerVscodeApi.EventEmitter() onDidSendMessage = this._onDidSendMessage.event - handleMessage (message: vscode.DebugProtocolMessage): void { + handleMessage(message: vscode.DebugProtocolMessage): void { this.websocket.send(JSON.stringify(message)) } - dispose () { + dispose() { this.websocket.close() } } debuggerVscodeApi.debug.registerDebugConfigurationProvider('javascript', { - resolveDebugConfiguration () { + resolveDebugConfiguration() { return { name: 'Test debugger', type: 'javascript', @@ -55,27 +62,34 @@ void getApi().then(async debuggerVscodeApi => { }) debuggerVscodeApi.debug.registerDebugAdapterDescriptorFactory('javascript', { - async createDebugAdapterDescriptor () { + async createDebugAdapterDescriptor() { const websocket = new WebSocket('ws://localhost:5555') await new Promise((resolve, reject) => { websocket.onopen = resolve - websocket.onerror = () => reject(new Error('Unable to connect to debugger server. Run `npm run start:debugServer`')) + websocket.onerror = () => + reject(new Error('Unable to connect to debugger server. Run `npm run start:debugServer`')) }) - websocket.send(JSON.stringify({ - main: '/workspace/test.js', - files: { - '/workspace/test.js': new TextDecoder().decode(await debuggerVscodeApi.workspace.fs.readFile(debuggerVscodeApi.Uri.file('/workspace/test.js'))) - } - })) + websocket.send( + JSON.stringify({ + main: '/workspace/test.js', + files: { + '/workspace/test.js': new TextDecoder().decode( + await debuggerVscodeApi.workspace.fs.readFile( + debuggerVscodeApi.Uri.file('/workspace/test.js') + ) + ) + } + }) + ) const adapter = new WebsocketDebugAdapter(websocket) // eslint-disable-next-line @typescript-eslint/no-explicit-any adapter.onDidSendMessage((message: any) => { if (message.type === 'event' && message.event === 'output') { - // eslint-disable-next-line no-console + // eslint-disable-next-line no-console console.log('OUTPUT', message.body.output) } }) diff --git a/demo/src/features/editor.ts b/demo/src/features/editor.ts index 17075abd..d75e0e03 100644 --- a/demo/src/features/editor.ts +++ b/demo/src/features/editor.ts @@ -1,10 +1,16 @@ -import { IResolvedTextEditorModel, IReference, OpenEditor } from '@codingame/monaco-vscode-views-service-override' +import { + IResolvedTextEditorModel, + IReference, + OpenEditor +} from '@codingame/monaco-vscode-views-service-override' import * as monaco from 'monaco-editor' -let currentEditor: ({ - modelRef: IReference - editor: monaco.editor.IStandaloneCodeEditor -} & monaco.IDisposable) | null = null +let currentEditor: + | ({ + modelRef: IReference + editor: monaco.editor.IStandaloneCodeEditor + } & monaco.IDisposable) + | null = null export const openNewCodeEditor: OpenEditor = async (modelRef) => { if (currentEditor != null) { currentEditor.dispose() @@ -18,7 +24,11 @@ export const openNewCodeEditor: OpenEditor = async (modelRef) => { const editorElem = document.createElement('div') editorElem.style.position = 'absolute' - editorElem.style.top = editorElem.style.bottom = editorElem.style.left = editorElem.style.right = '0' + editorElem.style.top = + editorElem.style.bottom = + editorElem.style.left = + editorElem.style.right = + '0' editorElem.style.margin = 'auto' editorElem.style.width = '80%' editorElem.style.height = '80%' @@ -27,14 +37,11 @@ export const openNewCodeEditor: OpenEditor = async (modelRef) => { document.body.appendChild(container) try { - const editor = monaco.editor.create( - editorElem, - { - model: modelRef.object.textEditorModel, - readOnly: true, - automaticLayout: true - } - ) + const editor = monaco.editor.create(editorElem, { + model: modelRef.object.textEditorModel, + readOnly: true, + automaticLayout: true + }) currentEditor = { dispose: () => { diff --git a/demo/src/features/intellisense.ts b/demo/src/features/intellisense.ts index 9ce08dcb..c23c6d4e 100644 --- a/demo/src/features/intellisense.ts +++ b/demo/src/features/intellisense.ts @@ -7,18 +7,23 @@ import '@codingame/monaco-vscode-markdown-language-features-default-extension' import '@codingame/monaco-vscode-emmet-default-extension' import { ExtensionHostKind, registerExtension } from 'vscode/extensions' -const { getApi } = registerExtension({ - name: 'fake-intellisense', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' - } -}, ExtensionHostKind.LocalProcess) +const { getApi } = registerExtension( + { + name: 'fake-intellisense', + publisher: 'codingame', + version: '1.0.0', + engines: { + vscode: '*' + } + }, + ExtensionHostKind.LocalProcess +) -void getApi().then(async api => { +void getApi().then(async (api) => { api.languages.registerCallHierarchyProvider('javascript', { - prepareCallHierarchy: function (): vscode.ProviderResult { + prepareCallHierarchy: function (): vscode.ProviderResult< + vscode.CallHierarchyItem | vscode.CallHierarchyItem[] + > { return { name: 'Fake call hierarchy', kind: api.SymbolKind.Class, @@ -27,46 +32,54 @@ void getApi().then(async api => { selectionRange: new api.Range(0, 0, 0, 10) } }, - provideCallHierarchyIncomingCalls: function (): vscode.ProviderResult { - return [{ - from: { - name: 'Fake incomming call', - kind: api.SymbolKind.Class, - uri: api.Uri.file('/workspace/test.js'), - range: new api.Range(0, 0, 0, 10), - selectionRange: new api.Range(0, 0, 0, 10) - }, - fromRanges: [new api.Range(2, 0, 2, 10)] - }] + provideCallHierarchyIncomingCalls: function (): vscode.ProviderResult< + vscode.CallHierarchyIncomingCall[] + > { + return [ + { + from: { + name: 'Fake incomming call', + kind: api.SymbolKind.Class, + uri: api.Uri.file('/workspace/test.js'), + range: new api.Range(0, 0, 0, 10), + selectionRange: new api.Range(0, 0, 0, 10) + }, + fromRanges: [new api.Range(2, 0, 2, 10)] + } + ] }, - provideCallHierarchyOutgoingCalls: function (): vscode.ProviderResult { + provideCallHierarchyOutgoingCalls: function (): vscode.ProviderResult< + vscode.CallHierarchyOutgoingCall[] + > { return [] } }) api.languages.registerHoverProvider('javascript', { - async provideHover (document, position) { + async provideHover(document, position) { return { contents: [ '# Hello', - `This is a hover on ${document.uri.toString()} at position ${position.line}:${position.character}` + `This is a hover on ${document.uri.toString()} at position ${position.line}:${position.character}` ] } } }) api.languages.registerCompletionItemProvider('javascript', { - provideCompletionItems () { - return [{ - label: 'Demo completion', - detail: 'This is a demo completion registered via the vscode api', - insertText: 'hello world' - }] + provideCompletionItems() { + return [ + { + label: 'Demo completion', + detail: 'This is a demo completion registered via the vscode api', + insertText: 'hello world' + } + ] } }) api.languages.registerDefinitionProvider('javascript', { - provideDefinition (document, position) { + provideDefinition(document, position) { const wordRange = document.getWordRangeAtPosition(position) if (wordRange != null && document.getText(wordRange) === 'anotherfile') { return { diff --git a/demo/src/features/notifications.ts b/demo/src/features/notifications.ts index 2a362a41..fee827df 100644 --- a/demo/src/features/notifications.ts +++ b/demo/src/features/notifications.ts @@ -1,21 +1,28 @@ import { ExtensionHostKind, registerExtension } from 'vscode/extensions' -const { getApi } = registerExtension({ - name: 'welcome-notifications', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' - } -}, ExtensionHostKind.LocalProcess) +const { getApi } = registerExtension( + { + name: 'welcome-notifications', + publisher: 'codingame', + version: '1.0.0', + engines: { + vscode: '*' + } + }, + ExtensionHostKind.LocalProcess +) -void getApi().then(async api => { - void api.window.showInformationMessage('Hello', { - detail: 'Welcome to the monaco-vscode-api demo', - modal: true - }).then(() => { - void api.window.showInformationMessage('Try to change the settings or the configuration, the changes will be applied to all 3 editors') - }) +void getApi().then(async (api) => { + void api.window + .showInformationMessage('Hello', { + detail: 'Welcome to the monaco-vscode-api demo', + modal: true + }) + .then(() => { + void api.window.showInformationMessage( + 'Try to change the settings or the configuration, the changes will be applied to all 3 editors' + ) + }) setTimeout(() => { api.workspace.onDidChangeConfiguration(() => { diff --git a/demo/src/features/output.ts b/demo/src/features/output.ts index 6290fd71..c6638796 100644 --- a/demo/src/features/output.ts +++ b/demo/src/features/output.ts @@ -2,25 +2,30 @@ import { ExtensionHostKind, registerExtension } from 'vscode/extensions' import { useHtmlFileSystemProvider } from '../setup.common' if (!useHtmlFileSystemProvider) { - const { getApi } = registerExtension({ - name: 'outputDemo', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' - } - }, ExtensionHostKind.LocalProcess) + const { getApi } = registerExtension( + { + name: 'outputDemo', + publisher: 'codingame', + version: '1.0.0', + engines: { + vscode: '*' + } + }, + ExtensionHostKind.LocalProcess + ) - void getApi().then(async vscode => { + void getApi().then(async (vscode) => { const fakeOutputChannel = vscode.window.createOutputChannel('Fake output') const anotherFakeOutputChannel = vscode.window.createOutputChannel('Your code', 'javascript') - fakeOutputChannel.append('Here\'s some fake output\n') + fakeOutputChannel.append("Here's some fake output\n") setInterval(() => { fakeOutputChannel.append('Hello world\n') }, 1000) - const mainDocument = await vscode.workspace.openTextDocument(vscode.Uri.file('/workspace/test.js')) + const mainDocument = await vscode.workspace.openTextDocument( + vscode.Uri.file('/workspace/test.js') + ) anotherFakeOutputChannel.replace(mainDocument.getText()) vscode.workspace.onDidChangeTextDocument((e) => { if (e.document === mainDocument && e.contentChanges.length > 0) { diff --git a/demo/src/features/scm.ts b/demo/src/features/scm.ts index ae1208c3..607883c1 100644 --- a/demo/src/features/scm.ts +++ b/demo/src/features/scm.ts @@ -3,19 +3,23 @@ import { ExtensionHostKind, registerExtension } from 'vscode/extensions' import { remoteAuthority } from '../setup.common' if (remoteAuthority == null) { - const { getApi } = registerExtension({ - name: 'scm-demo', - publisher: 'codingame', - engines: { - vscode: '*' + const { getApi } = registerExtension( + { + name: 'scm-demo', + publisher: 'codingame', + engines: { + vscode: '*' + }, + version: '1.0.0', + enabledApiProposals: ['scmActionButton'] }, - version: '1.0.0', - enabledApiProposals: ['scmActionButton'] - }, ExtensionHostKind.LocalProcess, { - system: true // to be able to use api proposals - }) + ExtensionHostKind.LocalProcess, + { + system: true // to be able to use api proposals + } + ) - void getApi().then(async vscode => { + void getApi().then(async (vscode) => { const workspaceFolder = vscode.workspace.workspaceFolders?.[0] if (workspaceFolder == null) { return @@ -29,7 +33,11 @@ if (remoteAuthority == null) { await vscode.window.showInformationMessage("You've committed!") }) - const scm = vscode.scm.createSourceControl('demo-source-control', 'Demo Source Control', workspaceFolder.uri) + const scm = vscode.scm.createSourceControl( + 'demo-source-control', + 'Demo Source Control', + workspaceFolder.uri + ) scm.inputBox.placeholder = 'Hello, you can write anything here!' scm.acceptInputCommand = { command: 'scm-demo.commit', @@ -45,24 +53,27 @@ if (remoteAuthority == null) { scm.count = 2 const group = scm.createResourceGroup('working-tree', 'Working Tree') - group.resourceStates = [{ - resourceUri: vscode.Uri.file('/workspace/test.js'), - command: { - title: 'Commit', - command: 'scm-demo.click-file', - arguments: [vscode.Uri.file('/workspace/test.js')] - } - }, { - resourceUri: vscode.Uri.file('/workspace/test_readonly.js'), - command: { - title: 'Commit', - command: 'scm-demo.click-file', - arguments: [vscode.Uri.file('/workspace/test_readonly.js')] + group.resourceStates = [ + { + resourceUri: vscode.Uri.file('/workspace/test.js'), + command: { + title: 'Commit', + command: 'scm-demo.click-file', + arguments: [vscode.Uri.file('/workspace/test.js')] + } }, - decorations: { - strikeThrough: true, - tooltip: 'File is read-only' + { + resourceUri: vscode.Uri.file('/workspace/test_readonly.js'), + command: { + title: 'Commit', + command: 'scm-demo.click-file', + arguments: [vscode.Uri.file('/workspace/test_readonly.js')] + }, + decorations: { + strikeThrough: true, + tooltip: 'File is read-only' + } } - }] + ] }) } diff --git a/demo/src/features/search.ts b/demo/src/features/search.ts index f5136288..4f4bfe9e 100644 --- a/demo/src/features/search.ts +++ b/demo/src/features/search.ts @@ -3,30 +3,52 @@ import * as monaco from 'monaco-editor' import { useHtmlFileSystemProvider } from '../setup.common' if (!useHtmlFileSystemProvider) { - const { getApi } = registerExtension({ - name: 'searchProvider', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' + const { getApi } = registerExtension( + { + name: 'searchProvider', + publisher: 'codingame', + version: '1.0.0', + engines: { + vscode: '*' + }, + enabledApiProposals: ['fileSearchProvider', 'textSearchProvider'] }, - enabledApiProposals: ['fileSearchProvider', 'textSearchProvider'] - }, ExtensionHostKind.LocalProcess, { - system: true // to be able to use api proposals - }) + ExtensionHostKind.LocalProcess, + { + system: true // to be able to use api proposals + } + ) - void getApi().then(async api => { + void getApi().then(async (api) => { api.workspace.registerFileSearchProvider('file', { - async provideFileSearchResults () { - return monaco.editor.getModels().map(model => model.uri).filter(uri => uri.scheme === 'file') + async provideFileSearchResults() { + return monaco.editor + .getModels() + .map((model) => model.uri) + .filter((uri) => uri.scheme === 'file') } }) api.workspace.registerTextSearchProvider('file', { - async provideTextSearchResults (query, _, progress) { + async provideTextSearchResults(query, _, progress) { for (const model of monaco.editor.getModels()) { - const matches = model.findMatches(query.pattern, false, query.isRegExp ?? false, query.isCaseSensitive ?? false, query.isWordMatch ?? false ? ' ' : null, true) + const matches = model.findMatches( + query.pattern, + false, + query.isRegExp ?? false, + query.isCaseSensitive ?? false, + (query.isWordMatch ?? false) ? ' ' : null, + true + ) if (matches.length > 0) { - const ranges = matches.map(match => new api.Range(match.range.startLineNumber, match.range.startColumn, match.range.endLineNumber, match.range.endColumn)) + const ranges = matches.map( + (match) => + new api.Range( + match.range.startLineNumber, + match.range.startColumn, + match.range.endLineNumber, + match.range.endColumn + ) + ) progress.report({ uri: model.uri, ranges, diff --git a/demo/src/features/terminal.ts b/demo/src/features/terminal.ts index baaca9bc..dd2497bb 100644 --- a/demo/src/features/terminal.ts +++ b/demo/src/features/terminal.ts @@ -1,4 +1,8 @@ -import { ITerminalChildProcess, SimpleTerminalBackend, SimpleTerminalProcess } from '@codingame/monaco-vscode-terminal-service-override' +import { + ITerminalChildProcess, + SimpleTerminalBackend, + SimpleTerminalProcess +} from '@codingame/monaco-vscode-terminal-service-override' import ansiColors from 'ansi-colors' import * as vscode from 'vscode' @@ -12,7 +16,7 @@ export class TerminalBackend extends SimpleTerminalBackend { }>() class FakeTerminalProcess extends SimpleTerminalProcess { private column = 0 - async start (): Promise { + async start(): Promise { ansiColors.enabled = true dataEmitter.fire(`This is a fake terminal\r\n${ansiColors.green('$')} `) setTimeout(() => { @@ -25,12 +29,12 @@ export class TerminalBackend extends SimpleTerminalBackend { override onDidChangeProperty = propertyEmitter.event - override shutdown (immediate: boolean): void { + override shutdown(immediate: boolean): void { // eslint-disable-next-line no-console console.log('shutdown', immediate) } - override input (data: string): void { + override input(data: string): void { for (const c of data) { if (c.charCodeAt(0) === 13) { dataEmitter.fire(`\r\n${ansiColors.green('$')} `) @@ -47,13 +51,12 @@ export class TerminalBackend extends SimpleTerminalBackend { } } - resize (cols: number, rows: number): void { + resize(cols: number, rows: number): void { // eslint-disable-next-line no-console console.log('resize', cols, rows) } - override clearBuffer (): void | Promise { - } + override clearBuffer(): void | Promise {} } return new FakeTerminalProcess(1, 1, '/workspace', dataEmitter.event) } diff --git a/demo/src/features/testing.ts b/demo/src/features/testing.ts index 012d4e5c..631268ca 100644 --- a/demo/src/features/testing.ts +++ b/demo/src/features/testing.ts @@ -1,25 +1,32 @@ import type * as vscode from 'vscode' import { ExtensionHostKind, registerExtension } from 'vscode/extensions' -const { getApi } = registerExtension({ - name: 'testing', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' +const { getApi } = registerExtension( + { + name: 'testing', + publisher: 'codingame', + version: '1.0.0', + engines: { + vscode: '*' + } + }, + ExtensionHostKind.LocalProcess, + { + system: true } -}, ExtensionHostKind.LocalProcess, { - system: true -}) +) -void getApi().then(async api => { +void getApi().then(async (api) => { const testRe = /^([0-9]+)\s*([+*/-])\s*([0-9]+)\s*=\s*([0-9]+)/ const headingRe = /^(#+)\s*(.+)$/ - const parseMarkdown = (text: string, events: { - onTest(range: vscode.Range, a: number, operator: string, b: number, expected: number): void - onHeading(range: vscode.Range, name: string, depth: number): void - }): void => { + const parseMarkdown = ( + text: string, + events: { + onTest(range: vscode.Range, a: number, operator: string, b: number, expected: number): void + onHeading(range: vscode.Range, name: string, depth: number): void + } + ): void => { const lines = text.split('\n') for (let lineNo = 0; lineNo < lines.length; lineNo++) { @@ -27,7 +34,10 @@ void getApi().then(async api => { const test = testRe.exec(line) if (test != null) { const [, a, operator, b, expected] = test - const range = new api.Range(new api.Position(lineNo, 0), new api.Position(lineNo, test[0].length)) + const range = new api.Range( + new api.Position(lineNo, 0), + new api.Position(lineNo, test[0].length) + ) events.onTest(range, Number(a), operator!, Number(b), Number(expected)) continue } @@ -35,7 +45,10 @@ void getApi().then(async api => { const heading = headingRe.exec(line) if (heading != null) { const [, pounds, name] = heading - const range = new api.Range(new api.Position(lineNo, 0), new api.Position(lineNo, line.length)) + const range = new api.Range( + new api.Position(lineNo, 0), + new api.Position(lineNo, line.length) + ) events.onHeading(range, name!, pounds!.length) } } @@ -62,7 +75,10 @@ void getApi().then(async api => { class TestFile { public didResolve = false - public async updateFromDisk (controller: vscode.TestController, item: vscode.TestItem): Promise { + public async updateFromDisk( + controller: vscode.TestController, + item: vscode.TestItem + ): Promise { try { const content = await getContentFromFilesystem(item.uri!) item.error = undefined @@ -73,10 +89,14 @@ void getApi().then(async api => { } /** - * Parses the tests from the input text, and updates the tests contained - * by this file to be those from the text, - */ - public updateFromContents (controller: vscode.TestController, content: string, item: vscode.TestItem): void { + * Parses the tests from the input text, and updates the tests contained + * by this file to be those from the text, + */ + public updateFromContents( + controller: vscode.TestController, + content: string, + item: vscode.TestItem + ): void { const ancestors = [{ item, children: [] as vscode.TestItem[] }] const thisGeneration = generationCounter++ this.didResolve = true @@ -118,40 +138,44 @@ void getApi().then(async api => { } class TestHeading { - constructor (public generation: number) { } + constructor(public generation: number) {} } type Operator = '+' | '-' | '*' | '/' class TestCase { - constructor ( + constructor( private readonly a: number, private readonly operator: Operator, private readonly b: number, private readonly expected: number, public generation: number - ) { } + ) {} - getLabel (): string { + getLabel(): string { return `${this.a} ${this.operator} ${this.b} = ${this.expected}` } - async run (item: vscode.TestItem, options: vscode.TestRun): Promise { + async run(item: vscode.TestItem, options: vscode.TestRun): Promise { const start = Date.now() - await new Promise(resolve => setTimeout(resolve, 1000 + Math.random() * 1000)) + await new Promise((resolve) => setTimeout(resolve, 1000 + Math.random() * 1000)) const actual = this.evaluate() const duration = Date.now() - start if (actual === this.expected) { options.passed(item, duration) } else { - const message = api.TestMessage.diff(`Expected ${item.label}`, String(this.expected), String(actual)) + const message = api.TestMessage.diff( + `Expected ${item.label}`, + String(this.expected), + String(actual) + ) message.location = new api.Location(item.uri!, item.range!) options.failed(item, message, duration) } } - private evaluate () { + private evaluate() { switch (this.operator) { case '-': return this.a - this.b @@ -169,7 +193,7 @@ void getApi().then(async api => { const fileChangedEmitter = new api.EventEmitter() const watchingTests = new Map() - fileChangedEmitter.event(uri => { + fileChangedEmitter.event((uri) => { if (watchingTests.has('ALL')) { startTestRun(new api.TestRunRequest(undefined, undefined, watchingTests.get('ALL'), true)) return @@ -199,13 +223,15 @@ void getApi().then(async api => { watchingTests.set('ALL', request.profile) cancellation.onCancellationRequested(() => watchingTests.delete('ALL')) } else { - request.include.forEach(item => watchingTests.set(item, request.profile)) - cancellation.onCancellationRequested(() => request.include!.forEach(item => watchingTests.delete(item))) + request.include.forEach((item) => watchingTests.set(item, request.profile)) + cancellation.onCancellationRequested(() => + request.include!.forEach((item) => watchingTests.delete(item)) + ) } } const startTestRun = (request: vscode.TestRunRequest) => { - const queue: { test: vscode.TestItem, data: TestCase }[] = [] + const queue: { test: vscode.TestItem; data: TestCase }[] = [] const run = ctrl.createTestRun(request) // map of file uris to statements on each line: type OptionalStatementCoverage = vscode.StatementCoverage | undefined @@ -235,7 +261,9 @@ void getApi().then(async api => { coveredLines.set( test.uri.toString(), lines.map((lineText, lineNo) => - lineText.trim().length > 0 ? new api.StatementCoverage(0, new api.Position(lineNo, 0)) : undefined + lineText.trim().length > 0 + ? new api.StatementCoverage(0, new api.Position(lineNo, 0)) + : undefined ) ) } catch { @@ -259,17 +287,19 @@ void getApi().then(async api => { const fileCoverage = coveredLines.get(test.uri!.toString()) const lineInfo = fileCoverage?.[lineNo] if (lineInfo != null) { - (lineInfo.executed as number)++ + ;(lineInfo.executed as number)++ } run.appendOutput(`Completed ${test.id}\r\n`) } for (const [uri, statements] of coveredLines) { - run.addCoverage(api.FileCoverage.fromDetails( - api.Uri.parse(uri), - statements.filter((s): s is vscode.StatementCoverage => s != null) - )) + run.addCoverage( + api.FileCoverage.fromDetails( + api.Uri.parse(uri), + statements.filter((s): s is vscode.StatementCoverage => s != null) + ) + ) } run.end() @@ -279,12 +309,14 @@ void getApi().then(async api => { } ctrl.refreshHandler = async () => { - await Promise.all(getWorkspaceTestPatterns().map(({ pattern }) => findInitialFiles(ctrl, pattern))) + await Promise.all( + getWorkspaceTestPatterns().map(({ pattern }) => findInitialFiles(ctrl, pattern)) + ) } ctrl.createRunProfile('Run Tests', api.TestRunProfileKind.Run, runHandler, true, undefined, true) - ctrl.resolveHandler = async item => { + ctrl.resolveHandler = async (item) => { if (item == null) { startWatchingWorkspace(ctrl, fileChangedEmitter) return @@ -296,7 +328,7 @@ void getApi().then(async api => { } } - function updateNodeForDocument (e: vscode.TextDocument) { + function updateNodeForDocument(e: vscode.TextDocument) { if (e.uri.scheme !== 'file') { return } @@ -314,9 +346,9 @@ void getApi().then(async api => { } api.workspace.onDidOpenTextDocument(updateNodeForDocument) - api.workspace.onDidChangeTextDocument(e => updateNodeForDocument(e.document)) + api.workspace.onDidChangeTextDocument((e) => updateNodeForDocument(e.document)) - function getOrCreateFile (controller: vscode.TestController, uri: vscode.Uri) { + function getOrCreateFile(controller: vscode.TestController, uri: vscode.Uri) { const existing = controller.items.get(uri.toString()) if (existing != null) { return { file: existing, data: testData.get(existing) as TestFile } @@ -332,45 +364,48 @@ void getApi().then(async api => { return { file, data } } - function gatherTestItems (collection: vscode.TestItemCollection) { + function gatherTestItems(collection: vscode.TestItemCollection) { const items: vscode.TestItem[] = [] - collection.forEach(item => items.push(item)) + collection.forEach((item) => items.push(item)) return items } - function getWorkspaceTestPatterns () { + function getWorkspaceTestPatterns() { if (api.workspace.workspaceFolders == null) { return [] } - return api.workspace.workspaceFolders.map(workspaceFolder => ({ + return api.workspace.workspaceFolders.map((workspaceFolder) => ({ workspaceFolder, pattern: new api.RelativePattern(workspaceFolder, '**/*.md') })) } - async function findInitialFiles (controller: vscode.TestController, pattern: vscode.GlobPattern) { + async function findInitialFiles(controller: vscode.TestController, pattern: vscode.GlobPattern) { for (const file of await api.workspace.findFiles(pattern)) { getOrCreateFile(controller, file) } } - function startWatchingWorkspace (controller: vscode.TestController, fileChangedEmitter: vscode.EventEmitter) { + function startWatchingWorkspace( + controller: vscode.TestController, + fileChangedEmitter: vscode.EventEmitter + ) { return getWorkspaceTestPatterns().map(({ pattern }) => { const watcher = api.workspace.createFileSystemWatcher(pattern) - watcher.onDidCreate(uri => { + watcher.onDidCreate((uri) => { getOrCreateFile(controller, uri) fileChangedEmitter.fire(uri) }) - watcher.onDidChange(async uri => { + watcher.onDidChange(async (uri) => { const { file, data } = getOrCreateFile(controller, uri) if (data.didResolve) { await data.updateFromDisk(controller, file) } fileChangedEmitter.fire(uri) }) - watcher.onDidDelete(uri => controller.items.delete(uri.toString())) + watcher.onDidDelete((uri) => controller.items.delete(uri.toString())) void findInitialFiles(controller, pattern) diff --git a/demo/src/loader.ts b/demo/src/loader.ts index 7ac486a3..6ea53cd9 100644 --- a/demo/src/loader.ts +++ b/demo/src/loader.ts @@ -2,20 +2,48 @@ const searchParams = new URLSearchParams(window.location.search) const locale = searchParams.get('locale') const localeLoader: Partial Promise>> = { - cs: async () => { await import('@codingame/monaco-vscode-language-pack-cs') }, - de: async () => { await import('@codingame/monaco-vscode-language-pack-de') }, - es: async () => { await import('@codingame/monaco-vscode-language-pack-es') }, - fr: async () => { await import('@codingame/monaco-vscode-language-pack-fr') }, - it: async () => { await import('@codingame/monaco-vscode-language-pack-it') }, - ja: async () => { await import('@codingame/monaco-vscode-language-pack-ja') }, - ko: async () => { await import('@codingame/monaco-vscode-language-pack-ko') }, - pl: async () => { await import('@codingame/monaco-vscode-language-pack-pl') }, - 'pt-br': async () => { await import('@codingame/monaco-vscode-language-pack-pt-br') }, - 'qps-ploc': async () => { await import('@codingame/monaco-vscode-language-pack-qps-ploc') }, - ru: async () => { await import('@codingame/monaco-vscode-language-pack-ru') }, - tr: async () => { await import('@codingame/monaco-vscode-language-pack-tr') }, - 'zh-hans': async () => { await import('@codingame/monaco-vscode-language-pack-zh-hans') }, - 'zh-hant': async () => { await import('@codingame/monaco-vscode-language-pack-zh-hant') } + cs: async () => { + await import('@codingame/monaco-vscode-language-pack-cs') + }, + de: async () => { + await import('@codingame/monaco-vscode-language-pack-de') + }, + es: async () => { + await import('@codingame/monaco-vscode-language-pack-es') + }, + fr: async () => { + await import('@codingame/monaco-vscode-language-pack-fr') + }, + it: async () => { + await import('@codingame/monaco-vscode-language-pack-it') + }, + ja: async () => { + await import('@codingame/monaco-vscode-language-pack-ja') + }, + ko: async () => { + await import('@codingame/monaco-vscode-language-pack-ko') + }, + pl: async () => { + await import('@codingame/monaco-vscode-language-pack-pl') + }, + 'pt-br': async () => { + await import('@codingame/monaco-vscode-language-pack-pt-br') + }, + 'qps-ploc': async () => { + await import('@codingame/monaco-vscode-language-pack-qps-ploc') + }, + ru: async () => { + await import('@codingame/monaco-vscode-language-pack-ru') + }, + tr: async () => { + await import('@codingame/monaco-vscode-language-pack-tr') + }, + 'zh-hans': async () => { + await import('@codingame/monaco-vscode-language-pack-zh-hans') + }, + 'zh-hant': async () => { + await import('@codingame/monaco-vscode-language-pack-zh-hant') + } } if (locale != null) { diff --git a/demo/src/main.common.ts b/demo/src/main.common.ts index 167c4285..6eaf2fb8 100644 --- a/demo/src/main.common.ts +++ b/demo/src/main.common.ts @@ -53,16 +53,19 @@ import '@codingame/monaco-vscode-npm-default-extension' import '@codingame/monaco-vscode-media-preview-default-extension' import '@codingame/monaco-vscode-ipynb-default-extension' -const { getApi } = registerExtension({ - name: 'demo-main', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' - } -}, ExtensionHostKind.LocalProcess) +const { getApi } = registerExtension( + { + name: 'demo-main', + publisher: 'codingame', + version: '1.0.0', + engines: { + vscode: '*' + } + }, + ExtensionHostKind.LocalProcess +) -void getApi().then(async vscode => { +void getApi().then(async (vscode) => { if (!useHtmlFileSystemProvider) { const mainModelUri = vscode.Uri.file('/workspace/test.js') await Promise.all([ @@ -71,13 +74,15 @@ void getApi().then(async vscode => { ]) const diagnostics = vscode.languages.createDiagnosticCollection('demo') - diagnostics.set(mainModelUri, [{ - range: new vscode.Range(2, 9, 2, 12), - severity: vscode.DiagnosticSeverity.Error, - message: 'This is not a real error, just a demo, don\'t worry', - source: 'Demo', - code: 42 - }]) + diagnostics.set(mainModelUri, [ + { + range: new vscode.Range(2, 9, 2, 12), + severity: vscode.DiagnosticSeverity.Error, + message: "This is not a real error, just a demo, don't worry", + source: 'Demo', + code: 42 + } + ]) } document.querySelector('#toggleFullWorkbench')!.addEventListener('click', async () => { diff --git a/demo/src/main.views.ts b/demo/src/main.views.ts index 9fb48cc7..7f1d7b60 100644 --- a/demo/src/main.views.ts +++ b/demo/src/main.views.ts @@ -1,7 +1,20 @@ -import { IDialogService, IEditorService, IPreferencesService, StandaloneServices, createInstance, getService } from 'vscode/services' +import { + IDialogService, + IEditorService, + IPreferencesService, + StandaloneServices, + createInstance, + getService +} from 'vscode/services' import * as monaco from 'monaco-editor' -import { defaultUserConfigurationFile, updateUserConfiguration } from '@codingame/monaco-vscode-configuration-service-override' -import { defaultUserKeybindindsFile, updateUserKeybindings } from '@codingame/monaco-vscode-keybindings-service-override' +import { + defaultUserConfigurationFile, + updateUserConfiguration +} from '@codingame/monaco-vscode-configuration-service-override' +import { + defaultUserKeybindindsFile, + updateUserKeybindings +} from '@codingame/monaco-vscode-keybindings-service-override' import { clearStorage, remoteAuthority } from './setup.views' import { CustomEditorInput } from './features/customView.views' import defaultConfiguration from './user/configuration.json?raw' @@ -36,9 +49,13 @@ document.querySelector('#clearStorage')!.addEventListener('click', async () => { }) const settingsEditorEl = document.getElementById('settings-editor')! -const settingsModelReference = await monaco.editor.createModelReference(defaultUserConfigurationFile) -function updateSettingsDirty () { - document.getElementById('settings-dirty')!.style.display = settingsModelReference.object.isDirty() ? 'inline' : 'none' +const settingsModelReference = await monaco.editor.createModelReference( + defaultUserConfigurationFile +) +function updateSettingsDirty() { + document.getElementById('settings-dirty')!.style.display = settingsModelReference.object.isDirty() + ? 'inline' + : 'none' } updateSettingsDirty() settingsModelReference.object.onDidChangeDirty(updateSettingsDirty) @@ -49,20 +66,21 @@ const settingEditor = monaco.editor.create(settingsEditorEl, { settingEditor.addAction({ id: 'custom-action', - async run () { + async run() { void (await getService(IDialogService)).info('Custom action executed!') }, label: 'Custom action visible in the command palette', - keybindings: [ - monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyK - ], + keybindings: [monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyK], contextMenuGroupId: 'custom' }) const keybindingsEditorEl = document.getElementById('keybindings-editor')! -const keybindingsModelReference = await monaco.editor.createModelReference(defaultUserKeybindindsFile) -function updateKeydinbingsDirty () { - document.getElementById('keybindings-dirty')!.style.display = keybindingsModelReference.object.isDirty() ? 'inline' : 'none' +const keybindingsModelReference = await monaco.editor.createModelReference( + defaultUserKeybindindsFile +) +function updateKeydinbingsDirty() { + document.getElementById('keybindings-dirty')!.style.display = + keybindingsModelReference.object.isDirty() ? 'inline' : 'none' } updateKeydinbingsDirty() keybindingsModelReference.object.onDidChangeDirty(updateKeydinbingsDirty) diff --git a/demo/src/setup.common.ts b/demo/src/setup.common.ts index 1f4c1bb8..0deb8d2d 100644 --- a/demo/src/setup.common.ts +++ b/demo/src/setup.common.ts @@ -1,6 +1,19 @@ -import getConfigurationServiceOverride, { IStoredWorkspace, initUserConfiguration } from '@codingame/monaco-vscode-configuration-service-override' -import getKeybindingsServiceOverride, { initUserKeybindings } from '@codingame/monaco-vscode-keybindings-service-override' -import { RegisteredFileSystemProvider, RegisteredMemoryFile, RegisteredReadOnlyFile, createIndexedDBProviders, registerHTMLFileSystemProvider, registerFileSystemOverlay, initFile } from '@codingame/monaco-vscode-files-service-override' +import getConfigurationServiceOverride, { + IStoredWorkspace, + initUserConfiguration +} from '@codingame/monaco-vscode-configuration-service-override' +import getKeybindingsServiceOverride, { + initUserKeybindings +} from '@codingame/monaco-vscode-keybindings-service-override' +import { + RegisteredFileSystemProvider, + RegisteredMemoryFile, + RegisteredReadOnlyFile, + createIndexedDBProviders, + registerHTMLFileSystemProvider, + registerFileSystemOverlay, + initFile +} from '@codingame/monaco-vscode-files-service-override' import * as monaco from 'monaco-editor' import { IWorkbenchConstructionOptions, LogLevel, IEditorOverrideServices } from 'vscode/services' import * as vscode from 'vscode' @@ -72,7 +85,8 @@ const url = new URL(document.location.href) const params = url.searchParams export const remoteAuthority = params.get('remoteAuthority') ?? undefined export const connectionToken = params.get('connectionToken') ?? undefined -export const remotePath = remoteAuthority != null ? params.get('remotePath') ?? undefined : undefined +export const remotePath = + remoteAuthority != null ? (params.get('remotePath') ?? undefined) : undefined export const resetLayout = params.has('resetLayout') export const useHtmlFileSystemProvider = params.has('htmlFileSystemProvider') params.delete('resetLayout') @@ -85,15 +99,25 @@ export const userDataProvider = await createIndexedDBProviders() if (useHtmlFileSystemProvider) { workspaceFile = monaco.Uri.from({ scheme: 'tmp', path: '/test.code-workspace' }) - await initFile(workspaceFile, JSON.stringify({ - folders: [] - }, null, 2)) + await initFile( + workspaceFile, + JSON.stringify( + { + folders: [] + }, + null, + 2 + ) + ) registerHTMLFileSystemProvider() } else { const fileSystemProvider = new RegisteredFileSystemProvider(false) - fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/workspace/test.js'), `// import anotherfile + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/test.js'), + `// import anotherfile let variable = 1 function inc () { variable++ @@ -103,12 +127,22 @@ while (variable < 5000) { inc() console.log('Hello world', variable); }` - )) + ) + ) const content = new TextEncoder().encode('This is a readonly static file') - fileSystemProvider.registerFile(new RegisteredReadOnlyFile(vscode.Uri.file('/workspace/test_readonly.js'), async () => content, content.length)) + fileSystemProvider.registerFile( + new RegisteredReadOnlyFile( + vscode.Uri.file('/workspace/test_readonly.js'), + async () => content, + content.length + ) + ) - fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/workspace/jsconfig.json'), `{ + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/jsconfig.json'), + `{ "compilerOptions": { "target": "es2020", "module": "esnext", @@ -118,9 +152,13 @@ while (variable < 5000) { ] } }` - )) + ) + ) - fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/workspace/index.html'), ` + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/index.html'), + ` @@ -138,9 +176,13 @@ while (variable < 5000) {

Hello, world!

` - )) + ) + ) - fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/workspace/test.md'), ` + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/test.md'), + ` ***Hello World*** Math block: @@ -161,30 +203,57 @@ $$ 230230 + 5819123 = 6049353 ` - )) + ) + ) - fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/workspace/test.customeditor'), ` + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/test.customeditor'), + ` Custom Editor!` - )) + ) + ) - fileSystemProvider.registerFile(new RegisteredMemoryFile(vscode.Uri.file('/workspace/test.css'), ` + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/test.css'), + ` h1 { color: DeepSkyBlue; }` - )) + ) + ) // Use a workspace file to be able to add another folder later (for the "Attach filesystem" button) - fileSystemProvider.registerFile(new RegisteredMemoryFile(workspaceFile, JSON.stringify({ - folders: [{ - path: '/workspace' - }] - }, null, 2))) + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + workspaceFile, + JSON.stringify( + { + folders: [ + { + path: '/workspace' + } + ] + }, + null, + 2 + ) + ) + ) - fileSystemProvider.registerFile(new RegisteredMemoryFile(monaco.Uri.file('/workspace/.vscode/extensions.json'), JSON.stringify({ - recommendations: [ - 'vscodevim.vim' - ] - }, null, 2))) + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + monaco.Uri.file('/workspace/.vscode/extensions.json'), + JSON.stringify( + { + recommendations: ['vscodevim.vim'] + }, + null, + 2 + ) + ) + ) registerFileSystemOverlay(1, fileSystemProvider) } @@ -192,13 +261,38 @@ h1 { // Workers export type WorkerLoader = () => Worker const workerLoaders: Partial> = { - TextEditorWorker: () => new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker.js', import.meta.url), { type: 'module' }), - TextMateWorker: () => new Worker(new URL('@codingame/monaco-vscode-textmate-service-override/worker', import.meta.url), { type: 'module' }), - OutputLinkDetectionWorker: () => new Worker(new URL('@codingame/monaco-vscode-output-service-override/worker', import.meta.url), { type: 'module' }), - LanguageDetectionWorker: () => new Worker(new URL('@codingame/monaco-vscode-language-detection-worker-service-override/worker', import.meta.url), { type: 'module' }), - NotebookEditorWorker: () => new Worker(new URL('@codingame/monaco-vscode-notebook-service-override/worker', import.meta.url), { type: 'module' }), - LocalFileSearchWorker: () => new Worker(new URL('@codingame/monaco-vscode-search-service-override/worker', import.meta.url), { type: 'module' }) - + TextEditorWorker: () => + new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker.js', import.meta.url), { + type: 'module' + }), + TextMateWorker: () => + new Worker( + new URL('@codingame/monaco-vscode-textmate-service-override/worker', import.meta.url), + { type: 'module' } + ), + OutputLinkDetectionWorker: () => + new Worker( + new URL('@codingame/monaco-vscode-output-service-override/worker', import.meta.url), + { type: 'module' } + ), + LanguageDetectionWorker: () => + new Worker( + new URL( + '@codingame/monaco-vscode-language-detection-worker-service-override/worker', + import.meta.url + ), + { type: 'module' } + ), + NotebookEditorWorker: () => + new Worker( + new URL('@codingame/monaco-vscode-notebook-service-override/worker', import.meta.url), + { type: 'module' } + ), + LocalFileSearchWorker: () => + new Worker( + new URL('@codingame/monaco-vscode-search-service-override/worker', import.meta.url), + { type: 'module' } + ) } window.MonacoEnvironment = { getWorker: function (moduleId, label) { @@ -227,17 +321,22 @@ export const constructOptions: IWorkbenchConstructionOptions = { }, workspaceProvider: { trusted: true, - async open () { + async open() { window.open(window.location.href) return true }, - workspace: remotePath == null - ? { - workspaceUri: workspaceFile - } - : { - folderUri: monaco.Uri.from({ scheme: 'vscode-remote', path: remotePath, authority: remoteAuthority }) - } + workspace: + remotePath == null + ? { + workspaceUri: workspaceFile + } + : { + folderUri: monaco.Uri.from({ + scheme: 'vscode-remote', + path: remotePath, + authority: remoteAuthority + }) + } }, developmentOptions: { logLevel: LogLevel.Info // Default value @@ -249,13 +348,16 @@ export const constructOptions: IWorkbenchConstructionOptions = { defaultLayout: { editors: useHtmlFileSystemProvider ? undefined - : [{ - uri: monaco.Uri.file('/workspace/test.js'), - viewColumn: 1 - }, { - uri: monaco.Uri.file('/workspace/test.md'), - viewColumn: 2 - }], + : [ + { + uri: monaco.Uri.file('/workspace/test.js'), + viewColumn: 1 + }, + { + uri: monaco.Uri.file('/workspace/test.md'), + viewColumn: 2 + } + ], layout: useHtmlFileSystemProvider ? undefined : { @@ -264,9 +366,11 @@ export const constructOptions: IWorkbenchConstructionOptions = { groups: [{ size: 1 }, { size: 1 }] } }, - views: [{ - id: 'custom-view' - }], + views: [ + { + id: 'custom-view' + } + ], force: resetLayout }, welcomeBanner: { @@ -354,65 +458,82 @@ export const commonServices: IEditorOverrideServices = { ...getUpdateServiceOverride(), ...getExplorerServiceOverride(), ...getLocalizationServiceOverride({ - async clearLocale () { + async clearLocale() { const url = new URL(window.location.href) url.searchParams.delete('locale') window.history.pushState(null, '', url.toString()) }, - async setLocale (id) { + async setLocale(id) { const url = new URL(window.location.href) url.searchParams.set('locale', id) window.history.pushState(null, '', url.toString()) }, - availableLanguages: [{ - locale: 'en', - languageName: 'English' - }, { - locale: 'cs', - languageName: 'Czech' - }, { - locale: 'de', - languageName: 'German' - }, { - locale: 'es', - languageName: 'Spanish' - }, { - locale: 'fr', - languageName: 'French' - }, { - locale: 'it', - languageName: 'Italian' - }, { - locale: 'ja', - languageName: 'Japanese' - }, { - locale: 'ko', - languageName: 'Korean' - }, { - locale: 'pl', - languageName: 'Polish' - }, { - locale: 'pt-br', - languageName: 'Portuguese (Brazil)' - }, { - locale: 'qps-ploc', - languageName: 'Pseudo Language' - }, { - locale: 'ru', - languageName: 'Russian' - }, { - locale: 'tr', - languageName: 'Turkish' - }, { - locale: 'zh-hans', - languageName: 'Chinese (Simplified)' - }, { - locale: 'zh-hant', - languageName: 'Chinese (Traditional)' - }, { - locale: 'en', - languageName: 'English' - }] + availableLanguages: [ + { + locale: 'en', + languageName: 'English' + }, + { + locale: 'cs', + languageName: 'Czech' + }, + { + locale: 'de', + languageName: 'German' + }, + { + locale: 'es', + languageName: 'Spanish' + }, + { + locale: 'fr', + languageName: 'French' + }, + { + locale: 'it', + languageName: 'Italian' + }, + { + locale: 'ja', + languageName: 'Japanese' + }, + { + locale: 'ko', + languageName: 'Korean' + }, + { + locale: 'pl', + languageName: 'Polish' + }, + { + locale: 'pt-br', + languageName: 'Portuguese (Brazil)' + }, + { + locale: 'qps-ploc', + languageName: 'Pseudo Language' + }, + { + locale: 'ru', + languageName: 'Russian' + }, + { + locale: 'tr', + languageName: 'Turkish' + }, + { + locale: 'zh-hans', + languageName: 'Chinese (Simplified)' + }, + { + locale: 'zh-hant', + languageName: 'Chinese (Traditional)' + }, + { + locale: 'en', + languageName: 'English' + } + ] }), ...getSecretStorageServiceOverride() } diff --git a/demo/src/setup.views.ts b/demo/src/setup.views.ts index b5af3763..70cda771 100644 --- a/demo/src/setup.views.ts +++ b/demo/src/setup.views.ts @@ -1,4 +1,9 @@ -import { IStorageService, IWorkbenchLayoutService, getService, initialize as initializeMonacoService } from 'vscode/services' +import { + IStorageService, + IWorkbenchLayoutService, + getService, + initialize as initializeMonacoService +} from 'vscode/services' import getQuickAccessServiceOverride from '@codingame/monaco-vscode-quickaccess-service-override' import { BrowserStorageService } from '@codingame/monaco-vscode-storage-service-override' import { ExtensionHostKind } from '@codingame/monaco-vscode-extensions-service-override' @@ -15,7 +20,13 @@ import getViewsServiceOverride, { } from '@codingame/monaco-vscode-views-service-override' import { openNewCodeEditor } from './features/editor' import './features/customView.views' -import { commonServices, constructOptions, envOptions, remoteAuthority, userDataProvider } from './setup.common' +import { + commonServices, + constructOptions, + envOptions, + remoteAuthority, + userDataProvider +} from './setup.common' const container = document.createElement('div') container.id = 'app' @@ -66,25 +77,48 @@ container.innerHTML = ` document.body.append(container) // Override services -await initializeMonacoService({ - ...commonServices, - ...getViewsServiceOverride(openNewCodeEditor, undefined), - - ...getQuickAccessServiceOverride({ - isKeybindingConfigurationVisible: isEditorPartVisible, - shouldUseGlobalPicker: (_editor, isStandalone) => !isStandalone && isEditorPartVisible() - }) -}, document.body, constructOptions, envOptions) +await initializeMonacoService( + { + ...commonServices, + ...getViewsServiceOverride(openNewCodeEditor, undefined), + + ...getQuickAccessServiceOverride({ + isKeybindingConfigurationVisible: isEditorPartVisible, + shouldUseGlobalPicker: (_editor, isStandalone) => !isStandalone && isEditorPartVisible() + }) + }, + document.body, + constructOptions, + envOptions +) for (const config of [ { part: Parts.TITLEBAR_PART, element: '#titleBar' }, { part: Parts.BANNER_PART, element: '#banner' }, - { part: Parts.SIDEBAR_PART, get element () { return getSideBarPosition() === Position.LEFT ? '#sidebar' : '#sidebar-right' }, onDidElementChange: onDidChangeSideBarPosition }, - { part: Parts.ACTIVITYBAR_PART, get element () { return getSideBarPosition() === Position.LEFT ? '#activityBar' : '#activityBar-right' }, onDidElementChange: onDidChangeSideBarPosition }, + { + part: Parts.SIDEBAR_PART, + get element() { + return getSideBarPosition() === Position.LEFT ? '#sidebar' : '#sidebar-right' + }, + onDidElementChange: onDidChangeSideBarPosition + }, + { + part: Parts.ACTIVITYBAR_PART, + get element() { + return getSideBarPosition() === Position.LEFT ? '#activityBar' : '#activityBar-right' + }, + onDidElementChange: onDidChangeSideBarPosition + }, { part: Parts.PANEL_PART, element: '#panel' }, { part: Parts.EDITOR_PART, element: '#editors' }, { part: Parts.STATUSBAR_PART, element: '#statusBar' }, - { part: Parts.AUXILIARYBAR_PART, get element () { return getSideBarPosition() === Position.LEFT ? '#auxiliaryBar' : '#auxiliaryBar-left' }, onDidElementChange: onDidChangeSideBarPosition } + { + part: Parts.AUXILIARYBAR_PART, + get element() { + return getSideBarPosition() === Position.LEFT ? '#auxiliaryBar' : '#auxiliaryBar-left' + }, + onDidElementChange: onDidChangeSideBarPosition + } ]) { attachPart(config.part, document.querySelector(config.element)!) @@ -96,8 +130,10 @@ for (const config of [ document.querySelector(config.element)!.style.display = 'none' } - onPartVisibilityChange(config.part, visible => { - document.querySelector(config.element)!.style.display = visible ? 'block' : 'none' + onPartVisibilityChange(config.part, (visible) => { + document.querySelector(config.element)!.style.display = visible + ? 'block' + : 'none' }) } @@ -107,23 +143,27 @@ document.querySelector('#togglePanel')!.addEventListener('click', async () => { }) document.querySelector('#toggleAuxiliary')!.addEventListener('click', async () => { - layoutService.setPartHidden(layoutService.isVisible(Parts.AUXILIARYBAR_PART, window), Parts.AUXILIARYBAR_PART) + layoutService.setPartHidden( + layoutService.isVisible(Parts.AUXILIARYBAR_PART, window), + Parts.AUXILIARYBAR_PART + ) }) -export async function clearStorage (): Promise { +export async function clearStorage(): Promise { await userDataProvider.reset() - await (await getService(IStorageService) as BrowserStorageService).clear() + await ((await getService(IStorageService)) as BrowserStorageService).clear() } -await registerExtension({ - name: 'demo', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' - } -}, ExtensionHostKind.LocalProcess).setAsDefaultApi() - -export { - remoteAuthority -} +await registerExtension( + { + name: 'demo', + publisher: 'codingame', + version: '1.0.0', + engines: { + vscode: '*' + } + }, + ExtensionHostKind.LocalProcess +).setAsDefaultApi() + +export { remoteAuthority } diff --git a/demo/src/setup.workbench.ts b/demo/src/setup.workbench.ts index 74254eb7..ec655be1 100644 --- a/demo/src/setup.workbench.ts +++ b/demo/src/setup.workbench.ts @@ -1,11 +1,24 @@ -import { IStorageService, IWorkbenchLayoutService, getService, initialize as initializeMonacoService } from 'vscode/services' -import getWorkbenchServiceOverride, { Parts } from '@codingame/monaco-vscode-workbench-service-override' +import { + IStorageService, + IWorkbenchLayoutService, + getService, + initialize as initializeMonacoService +} from 'vscode/services' +import getWorkbenchServiceOverride, { + Parts +} from '@codingame/monaco-vscode-workbench-service-override' import getQuickAccessServiceOverride from '@codingame/monaco-vscode-quickaccess-service-override' import { BrowserStorageService } from '@codingame/monaco-vscode-storage-service-override' import { ExtensionHostKind } from '@codingame/monaco-vscode-extensions-service-override' import { registerExtension } from 'vscode/extensions' import './features/customView.workbench' -import { commonServices, constructOptions, envOptions, remoteAuthority, userDataProvider } from './setup.common' +import { + commonServices, + constructOptions, + envOptions, + remoteAuthority, + userDataProvider +} from './setup.common' const container = document.createElement('div') container.style.height = '100vh' @@ -27,14 +40,19 @@ buttons.innerHTML = ` document.body.append(buttons) // Override services -await initializeMonacoService({ - ...commonServices, - ...getWorkbenchServiceOverride(), - ...getQuickAccessServiceOverride({ - isKeybindingConfigurationVisible: () => true, - shouldUseGlobalPicker: (_editor) => true - }) -}, container, constructOptions, envOptions) +await initializeMonacoService( + { + ...commonServices, + ...getWorkbenchServiceOverride(), + ...getQuickAccessServiceOverride({ + isKeybindingConfigurationVisible: () => true, + shouldUseGlobalPicker: (_editor) => true + }) + }, + container, + constructOptions, + envOptions +) const layoutService = await getService(IWorkbenchLayoutService) document.querySelector('#togglePanel')!.addEventListener('click', async () => { @@ -42,23 +60,27 @@ document.querySelector('#togglePanel')!.addEventListener('click', async () => { }) document.querySelector('#toggleAuxiliary')!.addEventListener('click', async () => { - layoutService.setPartHidden(layoutService.isVisible(Parts.AUXILIARYBAR_PART, window), Parts.AUXILIARYBAR_PART) + layoutService.setPartHidden( + layoutService.isVisible(Parts.AUXILIARYBAR_PART, window), + Parts.AUXILIARYBAR_PART + ) }) -export async function clearStorage (): Promise { +export async function clearStorage(): Promise { await userDataProvider.reset() - await (await getService(IStorageService) as BrowserStorageService).clear() + await ((await getService(IStorageService)) as BrowserStorageService).clear() } -await registerExtension({ - name: 'demo', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' - } -}, ExtensionHostKind.LocalProcess).setAsDefaultApi() +await registerExtension( + { + name: 'demo', + publisher: 'codingame', + version: '1.0.0', + engines: { + vscode: '*' + } + }, + ExtensionHostKind.LocalProcess +).setAsDefaultApi() -export { - remoteAuthority -} +export { remoteAuthority } diff --git a/demo/src/tools/crossOriginWorker.ts b/demo/src/tools/crossOriginWorker.ts index 74cef348..ca6e03b2 100644 --- a/demo/src/tools/crossOriginWorker.ts +++ b/demo/src/tools/crossOriginWorker.ts @@ -4,7 +4,7 @@ * importScripts accepts to load the code inside the blob worker */ class CrossOriginWorker extends Worker { - constructor (url: string | URL, options: WorkerOptions = {}) { + constructor(url: string | URL, options: WorkerOptions = {}) { const fullUrl = new URL(url, window.location.href).href const js = options.type === 'module' ? `import '${fullUrl}';` : `importScripts('${fullUrl}');` const blob = new Blob([js], { type: 'application/javascript' }) diff --git a/demo/src/tools/extHostWorker.ts b/demo/src/tools/extHostWorker.ts index b1d87710..f1042247 100644 --- a/demo/src/tools/extHostWorker.ts +++ b/demo/src/tools/extHostWorker.ts @@ -1,7 +1,9 @@ import type { WorkerConfig } from '@codingame/monaco-vscode-extensions-service-override' import { Worker } from './fakeWorker' -const fakeWorker = new Worker(new URL('vscode/workers/extensionHost.worker', import.meta.url), { type: 'module' }) +const fakeWorker = new Worker(new URL('vscode/workers/extensionHost.worker', import.meta.url), { + type: 'module' +}) export const workerConfig: WorkerConfig = { url: fakeWorker.url.toString(), diff --git a/demo/src/tools/fakeWorker.ts b/demo/src/tools/fakeWorker.ts index 212c6a50..da80a948 100644 --- a/demo/src/tools/fakeWorker.ts +++ b/demo/src/tools/fakeWorker.ts @@ -1,4 +1,6 @@ export class Worker { - constructor (public url: string | URL, public options?: WorkerOptions) { - } + constructor( + public url: string | URL, + public options?: WorkerOptions + ) {} } diff --git a/demo/src/types.d.ts b/demo/src/types.d.ts index 3c906aef..d86902f2 100644 --- a/demo/src/types.d.ts +++ b/demo/src/types.d.ts @@ -5,7 +5,7 @@ declare module '*?url' { declare module '*?worker' { interface WorkerConstructor { - new(): Worker + new (): Worker } const Worker: WorkerConstructor diff --git a/demo/vite.config.ts b/demo/vite.config.ts index d8457dc0..00e60b76 100644 --- a/demo/vite.config.ts +++ b/demo/vite.config.ts @@ -4,7 +4,9 @@ import * as fs from 'fs' import path from 'path' import pkg from './package.json' assert { type: 'json' } -const localDependencies = Object.entries(pkg.dependencies).filter(([, version]) => version.startsWith('file:../')).map(([name]) => name) +const localDependencies = Object.entries(pkg.dependencies) + .filter(([, version]) => version.startsWith('file:../')) + .map(([name]) => name) export default defineConfig({ build: { target: 'esnext' @@ -14,7 +16,7 @@ export default defineConfig({ // For the *-language-features extensions which use SharedArrayBuffer name: 'configure-response-headers', apply: 'serve', - configureServer: server => { + configureServer: (server) => { server.middlewares.use((_req, res, next) => { res.setHeader('Cross-Origin-Embedder-Policy', 'credentialless') res.setHeader('Cross-Origin-Opener-Policy', 'same-origin') @@ -26,7 +28,7 @@ export default defineConfig({ { name: 'force-prevent-transform-assets', apply: 'serve', - configureServer (server) { + configureServer(server) { return () => { server.middlewares.use(async (req, res, next) => { if (req.originalUrl != null) { @@ -52,11 +54,17 @@ export default defineConfig({ // add all local dependencies... ...localDependencies, // and their exports - 'vscode/extensions', 'vscode/services', 'vscode/monaco', 'vscode/localExtensionHost', + 'vscode/extensions', + 'vscode/services', + 'vscode/monaco', + 'vscode/localExtensionHost', // These 2 lines prevent vite from reloading the whole page when starting a worker (so 2 times in a row after cleaning the vite cache - for the editor then the textmate workers) // it's mainly empirical and probably not the best way, fix me if you find a better way - 'vscode-textmate', 'vscode-oniguruma', '@vscode/vscode-languagedetection', 'marked' + 'vscode-textmate', + 'vscode-oniguruma', + '@vscode/vscode-languagedetection', + 'marked' ], exclude: [], esbuildOptions: { diff --git a/demo/vite.netlify.config.ts b/demo/vite.netlify.config.ts index 1c0b198c..e497bf3f 100644 --- a/demo/vite.netlify.config.ts +++ b/demo/vite.netlify.config.ts @@ -1,7 +1,9 @@ import { defineConfig } from 'vite' import pkg from './package.json' assert { type: 'json' } -const localDependencies = Object.entries(pkg.dependencies).filter(([, version]) => version.startsWith('file:../')).map(([name]) => name) +const localDependencies = Object.entries(pkg.dependencies) + .filter(([, version]) => version.startsWith('file:../')) + .map(([name]) => name) export default defineConfig({ build: { diff --git a/release.ts b/release.ts index cc04cce4..7a92338a 100644 --- a/release.ts +++ b/release.ts @@ -17,7 +17,7 @@ if (NPM_TOKEN == null) { throw new Error('env.NPM_TOKEN must be set') } -async function publishNpm (version: string, tag: string) { +async function publishNpm(version: string, tag: string) { const distDir = path.resolve(__dirname, 'dist') for (const dirName of await fs.readdir(distDir)) { const libDir = path.resolve(distDir, dirName) @@ -29,14 +29,18 @@ async function publishNpm (version: string, tag: string) { packageJson.dependencies.vscode = `npm:@codingame/monaco-vscode-api@${version}` } if (packageJson.dependencies?.['monaco-editor'] != null) { - packageJson.dependencies['monaco-editor'] = `npm:@codingame/monaco-vscode-editor-api@${version}` + packageJson.dependencies['monaco-editor'] = + `npm:@codingame/monaco-vscode-editor-api@${version}` } for (const dependency in packageJson.dependencies) { if (dependency.startsWith('@codingame/monaco-vscode-')) { packageJson.dependencies[dependency] = version } } - await fs.writeFile(path.resolve(libDir, '.npmrc'), `//registry.npmjs.org/:_authToken=${NPM_TOKEN}\n`) + await fs.writeFile( + path.resolve(libDir, '.npmrc'), + `//registry.npmjs.org/:_authToken=${NPM_TOKEN}\n` + ) await fs.writeFile(packageJsonFile, JSON.stringify(packageJson, null, 2)) $.cwd = libDir @@ -45,14 +49,12 @@ async function publishNpm (version: string, tag: string) { } } -async function run (options: SemanticReleaseOptions) { - const result = await semanticRelease( - { - ...options, - ...semanticReleaseConfig, - plugins: semanticReleaseConfig.plugins?.filter(plugin => plugin !== '@semantic-release/npm') - } - ) +async function run(options: SemanticReleaseOptions) { + const result = await semanticRelease({ + ...options, + ...semanticReleaseConfig, + plugins: semanticReleaseConfig.plugins?.filter((plugin) => plugin !== '@semantic-release/npm') + }) if (result === false) { return @@ -66,14 +68,17 @@ async function run (options: SemanticReleaseOptions) { await publishNpm(result.nextRelease.version, result.nextRelease.channel ?? 'latest') } -async function cli () { +async function cli() { const stringList: Options = { type: 'string', array: true, coerce: (values: string[]) => values.length === 1 && values[0]!.trim() === 'false' ? [] - : values.reduce((values, value) => values.concat(value.split(',').map((value) => value.trim())), []) + : values.reduce( + (values, value) => values.concat(value.split(',').map((value) => value.trim())), + [] + ) } const argv = process.argv.slice(2) @@ -84,11 +89,31 @@ async function cli () { Usage: release [options] [plugins]`) }) - .option('b', { alias: 'branches', describe: 'Git branches to release from', ...stringList, group: 'Options' }) - .option('r', { alias: 'repository-url', describe: 'Git repository URL', type: 'string', group: 'Options' }) - .option('t', { alias: 'tag-format', describe: 'Git tag format', type: 'string', group: 'Options' }) + .option('b', { + alias: 'branches', + describe: 'Git branches to release from', + ...stringList, + group: 'Options' + }) + .option('r', { + alias: 'repository-url', + describe: 'Git repository URL', + type: 'string', + group: 'Options' + }) + .option('t', { + alias: 'tag-format', + describe: 'Git tag format', + type: 'string', + group: 'Options' + }) .option('p', { alias: 'plugins', describe: 'Plugins', ...stringList, group: 'Options' }) - .option('e', { alias: 'extends', describe: 'Shareable configurations', ...stringList, group: 'Options' }) + .option('e', { + alias: 'extends', + describe: 'Shareable configurations', + ...stringList, + group: 'Options' + }) .option('ci', { describe: 'Toggle CI verifications', type: 'boolean', group: 'Options' }) .option('verify-conditions', { ...stringList, group: 'Plugins' }) .option('analyze-commits', { type: 'string', group: 'Plugins' }) @@ -98,7 +123,12 @@ async function cli () { .option('publish', { ...stringList, group: 'Plugins' }) .option('success', { ...stringList, group: 'Plugins' }) .option('fail', { ...stringList, group: 'Plugins' }) - .option('d', { alias: 'dry-run', describe: 'Skip publishing', type: 'boolean', group: 'Options' }) + .option('d', { + alias: 'dry-run', + describe: 'Skip publishing', + type: 'boolean', + group: 'Options' + }) .option('h', { alias: 'help', group: 'Options' }) .strict(false) .exitProcess(false) @@ -112,7 +142,7 @@ async function cli () { await run(options) } -cli().catch(error => { +cli().catch((error) => { console.error(util.inspect(error, { colors: true })) process.exit(1) }) diff --git a/rollup/rollup-metadata-plugin.ts b/rollup/rollup-metadata-plugin.ts index 644b29f9..9a08200c 100644 --- a/rollup/rollup-metadata-plugin.ts +++ b/rollup/rollup-metadata-plugin.ts @@ -20,18 +20,35 @@ interface GroupResult { interface Options { stage?: 'generateBundle' | 'writeBundle' - getGroup?: (entryPoint: string, options: OutputOptions) => { name: string, publicName?: string, priority?: number } - handle (this: PluginContext, group: GroupResult, moduleGroupName: Map, otherDependencies: Set, options: OutputOptions, bundle: OutputBundle): void | Promise + getGroup?: ( + entryPoint: string, + options: OutputOptions + ) => { name: string; publicName?: string; priority?: number } + handle( + this: PluginContext, + group: GroupResult, + moduleGroupName: Map, + otherDependencies: Set, + options: OutputOptions, + bundle: OutputBundle + ): void | Promise } -export default ({ handle, getGroup = () => ({ name: 'main' }), stage = 'generateBundle' }: Options): Plugin => ({ +export default ({ + handle, + getGroup = () => ({ name: 'main' }), + stage = 'generateBundle' +}: Options): Plugin => ({ name: 'generate-metadata', [stage]: async function (this: PluginContext, options: OutputOptions, bundle: OutputBundle) { const dependencyCache = new Map>() const externalDependencyCache = new Map>() const moduleExternalDependencies = new Map>() - const getModuleDependencies = (id: string, paths: string[]): { internal: Set, external: Set } => { + const getModuleDependencies = ( + id: string, + paths: string[] + ): { internal: Set; external: Set } => { if (paths.includes(id)) { // Break recursive imports return { internal: new Set(), external: new Set() } @@ -50,11 +67,19 @@ export default ({ handle, getGroup = () => ({ name: 'main' }), stage = 'generate } dependencyCache.set(id, new Set()) } else if (!dependencyCache.has(id)) { - const dependencies = [...moduleInfo.importedIds, ...moduleInfo.dynamicallyImportedIds].map(depId => { - return getModuleDependencies(depId, [...paths, id]) - }) - dependencyCache.set(id, new Set([id, ...dependencies.flatMap(d => Array.from(d.internal))])) - externalDependencyCache.set(id, new Set(dependencies.flatMap(d => Array.from(d.external)))) + const dependencies = [...moduleInfo.importedIds, ...moduleInfo.dynamicallyImportedIds].map( + (depId) => { + return getModuleDependencies(depId, [...paths, id]) + } + ) + dependencyCache.set( + id, + new Set([id, ...dependencies.flatMap((d) => Array.from(d.internal))]) + ) + externalDependencyCache.set( + id, + new Set(dependencies.flatMap((d) => Array.from(d.external))) + ) } return { @@ -71,7 +96,8 @@ export default ({ handle, getGroup = () => ({ name: 'main' }), stage = 'generate continue } const { name: groupName, publicName, priority } = getGroup(id, options) - const { internal: internalDependencies, external: externalDependencies } = getModuleDependencies(moduleInfo.id, []) + const { internal: internalDependencies, external: externalDependencies } = + getModuleDependencies(moduleInfo.id, []) if (!groups.has(groupName)) { groups.set(groupName, { @@ -84,8 +110,8 @@ export default ({ handle, getGroup = () => ({ name: 'main' }), stage = 'generate }) } const group = groups.get(groupName)! - internalDependencies.forEach(d => group.modules.add(d)) - externalDependencies.forEach(d => group.dependencies.add(d)) + internalDependencies.forEach((d) => group.modules.add(d)) + externalDependencies.forEach((d) => group.dependencies.add(d)) group.entrypoints.add(id) if (publicName != null) { @@ -94,7 +120,11 @@ export default ({ handle, getGroup = () => ({ name: 'main' }), stage = 'generate } for (const group of groups.values()) { - group.groupDependencies = new Set(Array.from(group.dependencies).map(d => groupByPublicName.get(d)?.name).filter((g): g is string => g != null)) + group.groupDependencies = new Set( + Array.from(group.dependencies) + .map((d) => groupByPublicName.get(d)?.name) + .filter((g): g is string => g != null) + ) } const moduleGroups = new Map() @@ -110,16 +140,31 @@ export default ({ handle, getGroup = () => ({ name: 'main' }), stage = 'generate const moduleGroup = new Map() for (const [id, groups] of moduleGroups.entries()) { // Find a group that everyone depends on - const greatestPriority = Math.max(...groups.map(g => g.priority)) - const priorityGroups = groups.filter(g => g.priority >= greatestPriority) - moduleGroup.set(id, priorityGroups.find(group => priorityGroups.filter(ogroup => ogroup !== group).every(ogroup => ogroup.groupDependencies.has(group.name))) ?? null) + const greatestPriority = Math.max(...groups.map((g) => g.priority)) + const priorityGroups = groups.filter((g) => g.priority >= greatestPriority) + moduleGroup.set( + id, + priorityGroups.find((group) => + priorityGroups + .filter((ogroup) => ogroup !== group) + .every((ogroup) => ogroup.groupDependencies.has(group.name)) + ) ?? null + ) } - const moduleGroupName = new Map(Array.from(moduleGroup.entries()).map(([module, group]) => [module, group?.name])) + const moduleGroupName = new Map( + Array.from(moduleGroup.entries()).map(([module, group]) => [module, group?.name]) + ) const groupResults = Array.from(groups.entries()).map(([name, group]) => { - const exclusiveModules = new Set(Array.from(group.modules).filter(module => moduleGroup.get(module) === group)) - const directDependencies = new Set(Array.from(exclusiveModules).flatMap(module => Array.from(moduleExternalDependencies.get(module) ?? new Set()))) + const exclusiveModules = new Set( + Array.from(group.modules).filter((module) => moduleGroup.get(module) === group) + ) + const directDependencies = new Set( + Array.from(exclusiveModules).flatMap((module) => + Array.from(moduleExternalDependencies.get(module) ?? new Set()) + ) + ) return { directDependencies, @@ -129,15 +174,21 @@ export default ({ handle, getGroup = () => ({ name: 'main' }), stage = 'generate } }) - const otherDependencies = new Set(Array.from(moduleExternalDependencies.values()).map(set => Array.from(set)).flat()) + const otherDependencies = new Set( + Array.from(moduleExternalDependencies.values()) + .map((set) => Array.from(set)) + .flat() + ) for (const group of groupResults) { for (const directDependency of group.directDependencies) { otherDependencies.delete(directDependency) } } - await Promise.all(groupResults.map(async (group) => { - await handle.call(this, group, moduleGroupName, otherDependencies, options, bundle) - })) + await Promise.all( + groupResults.map(async (group) => { + await handle.call(this, group, moduleGroupName, otherDependencies, options, bundle) + }) + ) } }) diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index bf5c34cb..95a0a36f 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -61,18 +61,23 @@ const PURE_FUNCTIONS = new Set([ 'negate' ]) -const SIDE_EFFECT_CONSTRUCTORS = new Set([ - 'DomListener' -]) +const SIDE_EFFECT_CONSTRUCTORS = new Set(['DomListener']) -const PURE_OR_TO_REMOVE_FUNCTIONS = new Set([ - ...PURE_FUNCTIONS -]) +const PURE_OR_TO_REMOVE_FUNCTIONS = new Set([...PURE_FUNCTIONS]) /** * root files that should never be extracted from the main package to a service override package */ -const SHARED_ROOT_FILES_BETWEEN_PACKAGES = ['services.js', 'extensions.js', 'monaco.js', 'assets.js', 'lifecycle.js', 'workbench.js', 'missing-services.js', 'l10n.js'] +const SHARED_ROOT_FILES_BETWEEN_PACKAGES = [ + 'services.js', + 'extensions.js', + 'monaco.js', + 'assets.js', + 'lifecycle.js', + 'workbench.js', + 'missing-services.js', + 'l10n.js' +] /** * Files to expose in the editor-api package (just exporting everyting from the corresponding VSCode file) * for compability with libraries that import internal monaco-editor modules @@ -106,9 +111,14 @@ const VSCODE_DIR = nodePath.resolve(BASE_DIR, 'vscode') const VSCODE_SRC_DIR = nodePath.resolve(VSCODE_DIR, 'src') const OVERRIDE_PATH = nodePath.resolve(BASE_DIR, 'src/override') -function getMemberExpressionPath (node: recast.types.namedTypes.MemberExpression | recast.types.namedTypes.Identifier): string | null { +function getMemberExpressionPath( + node: recast.types.namedTypes.MemberExpression | recast.types.namedTypes.Identifier +): string | null { if (node.type === 'MemberExpression') { - if (node.property.type === 'Identifier' && (node.object.type === 'Identifier' || node.object.type === 'MemberExpression')) { + if ( + node.property.type === 'Identifier' && + (node.object.type === 'Identifier' || node.object.type === 'MemberExpression') + ) { const parentName = getMemberExpressionPath(node.object) if (parentName == null) { return null @@ -121,7 +131,11 @@ function getMemberExpressionPath (node: recast.types.namedTypes.MemberExpression return null } -function isCallPure (file: string, functionName: string, node: recast.types.namedTypes.CallExpression): boolean { +function isCallPure( + file: string, + functionName: string, + node: recast.types.namedTypes.CallExpression +): boolean { const args = node.arguments if (functionName === '__decorate') { const code = recast.print(node).code @@ -133,9 +147,7 @@ function isCallPure (file: string, functionName: string, node: recast.types.name if (functionName === 'MenuRegistry.appendMenuItem') { const firstParamCode = recast.print(args[0]!).code - if ( - firstParamCode.startsWith('MenuId.AccountsContext') - ) { + if (firstParamCode.startsWith('MenuId.AccountsContext')) { return true } } @@ -158,8 +170,9 @@ function isCallPure (file: string, functionName: string, node: recast.types.name const nlsKeys: [moduleId: string, keys: string[]][] = [] let nlsIndex = 0 -function transformVSCodeCode (id: string, code: string) { - const translationPath = nodePath.relative(id.startsWith(OVERRIDE_PATH) ? OVERRIDE_PATH : VSCODE_SRC_DIR, id) +function transformVSCodeCode(id: string, code: string) { + const translationPath = nodePath + .relative(id.startsWith(OVERRIDE_PATH) ? OVERRIDE_PATH : VSCODE_SRC_DIR, id) .slice(0, -3) // remove extension .replace(/\._[^/.]*/g, '') // remove own refactor module suffixes @@ -174,7 +187,10 @@ function transformVSCodeCode (id: string, code: string) { // memoize // ], InlineBreakpointWidget.prototype, "getId", null); - let patchedCode = code.replace(/(^__decorate\(\[\n.*\n\], (.*).prototype)/gm, '$2.__decorator = $1') + let patchedCode = code.replace( + /(^__decorate\(\[\n.*\n\], (.*).prototype)/gm, + '$2.__decorator = $1' + ) const moduleNlsKeys: string[] = [] @@ -182,8 +198,10 @@ function transformVSCodeCode (id: string, code: string) { parser: babylonParser }) let transformed: boolean = false - function addComment (node: recast.types.namedTypes.NewExpression | recast.types.namedTypes.CallExpression) { - if (!(node.comments ?? []).some(comment => comment.value === PURE_ANNO)) { + function addComment( + node: recast.types.namedTypes.NewExpression | recast.types.namedTypes.CallExpression + ) { + if (!(node.comments ?? []).some((comment) => comment.value === PURE_ANNO)) { transformed = true node.comments ??= [] node.comments.unshift(recast.types.builders.commentBlock(PURE_ANNO, true)) @@ -192,16 +210,19 @@ function transformVSCodeCode (id: string, code: string) { return node } recast.visit(ast.program.body, { - visitNewExpression (path) { + visitNewExpression(path) { const node = path.node if (node.callee.type === 'Identifier' && !SIDE_EFFECT_CONSTRUCTORS.has(node.callee.name)) { path.replace(addComment(node)) } this.traverse(path) }, - visitCallExpression (path) { + visitCallExpression(path) { const node = path.node - const name = node.callee.type === 'MemberExpression' || node.callee.type === 'Identifier' ? getMemberExpressionPath(node.callee) : null + const name = + node.callee.type === 'MemberExpression' || node.callee.type === 'Identifier' + ? getMemberExpressionPath(node.callee) + : null if (name != null && (name.endsWith('localize') || name.endsWith('localize2'))) { let localizationKey: string @@ -209,7 +230,12 @@ function transformVSCodeCode (id: string, code: string) { localizationKey = path.node.arguments[0].value } else if (path.node.arguments[0]?.type === 'ObjectExpression') { const properties = path.node.arguments[0].properties - const keyProperty = properties.find((prop): prop is recast.types.namedTypes.ObjectProperty => prop.type === 'ObjectProperty' && prop.key.type === 'Identifier' && prop.key.name === 'key') + const keyProperty = properties.find( + (prop): prop is recast.types.namedTypes.ObjectProperty => + prop.type === 'ObjectProperty' && + prop.key.type === 'Identifier' && + prop.key.name === 'key' + ) if (keyProperty == null) { throw new Error('No key property') } @@ -217,7 +243,11 @@ function transformVSCodeCode (id: string, code: string) { throw new Error('Key property is not literal') } localizationKey = keyProperty.value.value - } else if (path.node.arguments[0]?.type === 'TemplateLiteral' && path.node.arguments[0].expressions.length === 0 && path.node.arguments[0].quasis.length === 1) { + } else if ( + path.node.arguments[0]?.type === 'TemplateLiteral' && + path.node.arguments[0].expressions.length === 0 && + path.node.arguments[0].quasis.length === 1 + ) { localizationKey = path.node.arguments[0].quasis[0]!.value.raw } else { throw new Error('Unable to extract translation key') @@ -227,10 +257,12 @@ function transformVSCodeCode (id: string, code: string) { if (moduleNlsIndex === -1) { moduleNlsIndex = moduleNlsKeys.push(localizationKey) - 1 } - path.replace(recast.types.builders.callExpression( - path.node.callee, - [recast.types.builders.numericLiteral(nlsIndex + moduleNlsIndex), ...path.node.arguments.slice(1)] - )) + path.replace( + recast.types.builders.callExpression(path.node.callee, [ + recast.types.builders.numericLiteral(nlsIndex + moduleNlsIndex), + ...path.node.arguments.slice(1) + ]) + ) transformed = true } else if (node.callee.type === 'MemberExpression') { if (node.callee.property.type === 'Identifier') { @@ -238,7 +270,7 @@ function transformVSCodeCode (id: string, code: string) { if (name != null) { names.unshift(name) } - if (names.some(name => isCallPure(id, name, node))) { + if (names.some((name) => isCallPure(id, name, node))) { path.replace(addComment(node)) } } @@ -246,7 +278,8 @@ function transformVSCodeCode (id: string, code: string) { path.replace(addComment(node)) } else if (node.callee.type === 'FunctionExpression') { const lastInstruction = node.callee.body.body[node.callee.body.body.length - 1] - const lastInstructionIsReturn = lastInstruction?.type === 'ReturnStatement' && lastInstruction.argument != null + const lastInstructionIsReturn = + lastInstruction?.type === 'ReturnStatement' && lastInstruction.argument != null if (node.arguments.length > 0 || lastInstructionIsReturn) { // heuristic: mark IIFE with parameters or with a return as pure, because typescript compile enums as IIFE path.replace(addComment(node)) @@ -254,7 +287,7 @@ function transformVSCodeCode (id: string, code: string) { } this.traverse(path) }, - visitClassDeclaration (path) { + visitClassDeclaration(path) { /** * The whole point of this method is to transform to static field declarations * ``` @@ -284,13 +317,28 @@ function transformVSCodeCode (id: string, code: string) { const parentIndex = statemementListPath.value.indexOf(path.node) for (let i = parentIndex + 1; i < path.parentPath.value.length; ++i) { const node: recast.types.namedTypes.Node = path.parentPath.value[i] - function isExpressionStatement (node: recast.types.namedTypes.Node): node is recast.types.namedTypes.ExpressionStatement { + function isExpressionStatement( + node: recast.types.namedTypes.Node + ): node is recast.types.namedTypes.ExpressionStatement { return node.type === 'ExpressionStatement' } - function isLiteral (node: recast.types.namedTypes.Node): node is recast.types.namedTypes.NumericLiteral | recast.types.namedTypes.Literal | recast.types.namedTypes.BooleanLiteral | recast.types.namedTypes.DecimalLiteral { - return ['NumericLiteral', 'Literal', 'StringLiteral', 'BooleanLiteral', 'DecimalLiteral'].includes(node.type) + function isLiteral( + node: recast.types.namedTypes.Node + ): node is + | recast.types.namedTypes.NumericLiteral + | recast.types.namedTypes.Literal + | recast.types.namedTypes.BooleanLiteral + | recast.types.namedTypes.DecimalLiteral { + return [ + 'NumericLiteral', + 'Literal', + 'StringLiteral', + 'BooleanLiteral', + 'DecimalLiteral' + ].includes(node.type) } - if (isExpressionStatement(node) && + if ( + isExpressionStatement(node) && node.expression.type === 'AssignmentExpression' && node.expression.left.type === 'MemberExpression' && node.expression.left.object.type === 'Identifier' && @@ -299,7 +347,14 @@ function transformVSCodeCode (id: string, code: string) { isLiteral(node.expression.right) ) { const fieldName = node.expression.left.property.name - path.node.body.body.push(recast.types.builders.classProperty(recast.types.builders.identifier(fieldName), node.expression.right, null, true)) + path.node.body.body.push( + recast.types.builders.classProperty( + recast.types.builders.identifier(fieldName), + node.expression.right, + null, + true + ) + ) path.parentPath.value.splice(i--, 1) transformed = true } else { @@ -323,7 +378,7 @@ function transformVSCodeCode (id: string, code: string) { return patchedCode } -function resolveVscode (importee: string, importer?: string) { +function resolveVscode(importee: string, importer?: string) { if (importee.endsWith('.js')) { importee = importee.slice(0, -3) } @@ -332,7 +387,11 @@ function resolveVscode (importee: string, importer?: string) { } // import weak so that AbstractTextEditor is not imported just to do an instanceof on it - if (importer != null && importer.includes('vs/workbench/api/browser/mainThreadDocumentsAndEditors') && importee.includes('browser/parts/editor/textEditor')) { + if ( + importer != null && + importer.includes('vs/workbench/api/browser/mainThreadDocumentsAndEditors') && + importee.includes('browser/parts/editor/textEditor') + ) { importee = importee.replace('textEditor', 'textEditor.weak') } @@ -363,22 +422,21 @@ const input = { l10n: './src/l10n.ts', monaco: './src/monaco.ts', ...Object.fromEntries( - fs.readdirSync(nodePath.resolve(SRC_DIR, 'service-override'), { withFileTypes: true }) - .filter(f => f.isFile()) - .map(f => f.name) - .map(name => [ + fs + .readdirSync(nodePath.resolve(SRC_DIR, 'service-override'), { withFileTypes: true }) + .filter((f) => f.isFile()) + .map((f) => f.name) + .map((name) => [ `service-override/${nodePath.basename(name, '.ts')}`, `./src/service-override/${name}` ]) ), ...Object.fromEntries( - fs.readdirSync(nodePath.resolve(SRC_DIR, 'workers'), { withFileTypes: true }) - .filter(f => f.isFile()) - .map(f => f.name) - .map(name => [ - `workers/${nodePath.basename(name, '.ts')}`, - `./src/workers/${name}` - ]) + fs + .readdirSync(nodePath.resolve(SRC_DIR, 'workers'), { withFileTypes: true }) + .filter((f) => f.isFile()) + .map((f) => f.name) + .map((name) => [`workers/${nodePath.basename(name, '.ts')}`, `./src/workers/${name}`]) ) } @@ -393,7 +451,7 @@ const workerGroups: Record = { const externals = Object.keys({ ...pkg.dependencies }) const external: rollup.ExternalOption = (source) => { if (source.includes('tas-client-umd')) return true - return externals.some(external => source === external || source.startsWith(`${external}/`)) + return externals.some((external) => source === external || source.startsWith(`${external}/`)) } export default (args: Record): rollup.RollupOptions[] => { @@ -406,813 +464,922 @@ export default (args: Record): rollup.RollupOptions[] => { if (vscodeVersion == null) { throw new Error('Vscode version is mandatory') } - return rollup.defineConfig([{ - cache: false, - treeshake: { - annotations: true, - preset: 'smallest', - moduleSideEffects: true, - tryCatchDeoptimization: true - }, - external, - output: [{ - preserveModules: true, - preserveModulesRoot: 'src', - minifyInternalExports: false, - assetFileNames: 'assets/[name][extname]', - format: 'esm', - dir: 'dist/main', - entryFileNames: (chunkInfo) => { - // Rename node_modules to external so it's not removing while publishing the package - // tslib and rollup-plugin-styles and bundled - if (chunkInfo.name.includes('node_modules')) { - return chunkInfo.name.replace('node_modules', 'external') + '.js' - } - return '[name].js' + return rollup.defineConfig([ + { + cache: false, + treeshake: { + annotations: true, + preset: 'smallest', + moduleSideEffects: true, + tryCatchDeoptimization: true }, - chunkFileNames: '[name].js', - hoistTransitiveImports: false - }], - input, - plugins: [ - importMetaAssets({ - include: ['**/*.ts', '**/*.js'] - }), - commonjs({ - include: '**/vscode-semver/**/*' - }), - { - name: 'resolve-vscode', - resolveId: (importeeUrl, importer) => { - const result = /^(.*?)(\?.*)?$/.exec(importeeUrl)! - const importee = result[1]! - const search = result[2] ?? '' + external, + output: [ + { + preserveModules: true, + preserveModulesRoot: 'src', + minifyInternalExports: false, + assetFileNames: 'assets/[name][extname]', + format: 'esm', + dir: 'dist/main', + entryFileNames: (chunkInfo) => { + // Rename node_modules to external so it's not removing while publishing the package + // tslib and rollup-plugin-styles and bundled + if (chunkInfo.name.includes('node_modules')) { + return chunkInfo.name.replace('node_modules', 'external') + '.js' + } + return '[name].js' + }, + chunkFileNames: '[name].js', + hoistTransitiveImports: false + } + ], + input, + plugins: [ + importMetaAssets({ + include: ['**/*.ts', '**/*.js'] + }), + commonjs({ + include: '**/vscode-semver/**/*' + }), + { + name: 'resolve-vscode', + resolveId: (importeeUrl, importer) => { + const result = /^(.*?)(\?.*)?$/.exec(importeeUrl)! + const importee = result[1]! + const search = result[2] ?? '' - const resolved = resolveVscode(importee, importer) + const resolved = resolveVscode(importee, importer) - if (resolved != null) { - return `${resolved}${search}` - } - return undefined - }, - async load (id) { - if (!id.startsWith(VSCODE_SRC_DIR) && !id.startsWith(OVERRIDE_PATH)) { - return undefined - } - if (!id.endsWith('.js') && !id.endsWith('.ts')) { + if (resolved != null) { + return `${resolved}${search}` + } return undefined - } + }, + async load(id) { + if (!id.startsWith(VSCODE_SRC_DIR) && !id.startsWith(OVERRIDE_PATH)) { + return undefined + } + if (!id.endsWith('.js') && !id.endsWith('.ts')) { + return undefined + } - const content = (await fs.promises.readFile(id)).toString('utf-8') - return transformVSCodeCode(id, content) + const content = (await fs.promises.readFile(id)).toString('utf-8') + return transformVSCodeCode(id, content) + }, + async writeBundle() { + await fs.promises.writeFile( + nodePath.resolve(DIST_DIR, 'nls.keys.json'), + JSON.stringify(nlsKeys, null, 2) + ) + } }, - async writeBundle () { - await fs.promises.writeFile(nodePath.resolve(DIST_DIR, 'nls.keys.json'), JSON.stringify(nlsKeys, null, 2)) - } - }, - { - name: 'resolve-asset-url', - resolveFileUrl (options) { - let relativePath = options.relativePath - if (!relativePath.startsWith('.')) { - relativePath = `./${options.relativePath}` + { + name: 'resolve-asset-url', + resolveFileUrl(options) { + let relativePath = options.relativePath + if (!relativePath.startsWith('.')) { + relativePath = `./${options.relativePath}` + } + return `'${relativePath}'` } - return `'${relativePath}'` - } - }, - nodeResolve({ - extensions: EXTENSIONS - }), - typescript({ - noEmitOnError: true, - tsconfig: TSCONFIG, - compilerOptions: { - outDir: 'dist/main' }, - transformers: { - before: [{ - type: 'program', - factory: function factory (program) { - return function transformerFactory (context) { - return function transformer (sourceFile) { - if (sourceFile.fileName.endsWith('extension.api.ts')) { - let exportEqualsFound = false - function visitor (node: ts.Node): ts.Node { - // Transform `export = api` to `export { field1, field2, ... } = api` as the first syntax is not supported when generating ESM - if (ts.isExportAssignment(node) && (node.isExportEquals ?? false)) { - if (ts.isIdentifier(node.expression)) { - const declaration = program.getTypeChecker().getSymbolAtLocation(node.expression)!.declarations![0]! - if (ts.isVariableDeclaration(declaration) && declaration.initializer != null && ts.isObjectLiteralExpression(declaration.initializer)) { - const propertyNames = declaration.initializer.properties.map(prop => (prop.name as ts.Identifier).text) - exportEqualsFound = true - return context.factory.createVariableStatement([ - context.factory.createModifier(ts.SyntaxKind.ExportKeyword) - ], context.factory.createVariableDeclarationList([ - context.factory.createVariableDeclaration( - context.factory.createObjectBindingPattern( - propertyNames.map(name => context.factory.createBindingElement(undefined, undefined, context.factory.createIdentifier(name))) - ), - undefined, - undefined, - node.expression - ) - ], ts.NodeFlags.Const)) + nodeResolve({ + extensions: EXTENSIONS + }), + typescript({ + noEmitOnError: true, + tsconfig: TSCONFIG, + compilerOptions: { + outDir: 'dist/main' + }, + transformers: { + before: [ + { + type: 'program', + factory: function factory(program) { + return function transformerFactory(context) { + return function transformer(sourceFile) { + if (sourceFile.fileName.endsWith('extension.api.ts')) { + let exportEqualsFound = false + function visitor(node: ts.Node): ts.Node { + // Transform `export = api` to `export { field1, field2, ... } = api` as the first syntax is not supported when generating ESM + if (ts.isExportAssignment(node) && (node.isExportEquals ?? false)) { + if (ts.isIdentifier(node.expression)) { + const declaration = program + .getTypeChecker() + .getSymbolAtLocation(node.expression)!.declarations![0]! + if ( + ts.isVariableDeclaration(declaration) && + declaration.initializer != null && + ts.isObjectLiteralExpression(declaration.initializer) + ) { + const propertyNames = declaration.initializer.properties.map( + (prop) => (prop.name as ts.Identifier).text + ) + exportEqualsFound = true + return context.factory.createVariableStatement( + [context.factory.createModifier(ts.SyntaxKind.ExportKeyword)], + context.factory.createVariableDeclarationList( + [ + context.factory.createVariableDeclaration( + context.factory.createObjectBindingPattern( + propertyNames.map((name) => + context.factory.createBindingElement( + undefined, + undefined, + context.factory.createIdentifier(name) + ) + ) + ), + undefined, + undefined, + node.expression + ) + ], + ts.NodeFlags.Const + ) + ) + } + } } + return node } + const transformed = ts.visitEachChild(sourceFile, visitor, context) + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (!exportEqualsFound) { + throw new Error('`export =` not found in api.ts') + } + return transformed } - return node - } - const transformed = ts.visitEachChild(sourceFile, visitor, context) - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (!exportEqualsFound) { - throw new Error('`export =` not found in api.ts') + return sourceFile } - return transformed } - return sourceFile } } - } - }] - } - }), replace({ - VSCODE_VERSION: JSON.stringify(vscodeVersion), - VSCODE_REF: JSON.stringify(vscodeRef), - VSCODE_COMMIT: JSON.stringify(vscodeCommit), - 'globalThis.require': 'undefined', - preventAssignment: true - }), - (() => { - const realPaths = new Map() - return { - name: 'vscode-asset-glob-meta-url', - async resolveId (importee) { - if (!importee.includes('*')) { - return null - } + ] + } + }), + replace({ + VSCODE_VERSION: JSON.stringify(vscodeVersion), + VSCODE_REF: JSON.stringify(vscodeRef), + VSCODE_COMMIT: JSON.stringify(vscodeCommit), + 'globalThis.require': 'undefined', + preventAssignment: true + }), + (() => { + const realPaths = new Map() + return { + name: 'vscode-asset-glob-meta-url', + async resolveId(importee) { + if (!importee.includes('*')) { + return null + } - const fakePath = nodePath.resolve(VSCODE_SRC_DIR, importee.replace(/\*/, 'all')) - realPaths.set(fakePath, importee) - return fakePath - }, - async load (id) { - const realPath = realPaths.get(id) - if (realPath == null) { - return undefined - } - const files = await glob(realPath, { cwd: VSCODE_SRC_DIR }) + const fakePath = nodePath.resolve(VSCODE_SRC_DIR, importee.replace(/\*/, 'all')) + realPaths.set(fakePath, importee) + return fakePath + }, + async load(id) { + const realPath = realPaths.get(id) + if (realPath == null) { + return undefined + } + const files = await glob(realPath, { cwd: VSCODE_SRC_DIR }) - const fileRefs = await Promise.all(files.map(async file => { - const filePath = nodePath.resolve(VSCODE_SRC_DIR, file) - const ref = this.emitFile({ - type: 'asset', - name: nodePath.basename(file), - source: await fs.promises.readFile(filePath) - }) - return { file, ref } - })) - return `export default {${fileRefs.map(({ file, ref }) => `\n '${file}': new URL(import.meta.ROLLUP_FILE_URL_${ref}, import.meta.url).href`).join(',')}\n}` + const fileRefs = await Promise.all( + files.map(async (file) => { + const filePath = nodePath.resolve(VSCODE_SRC_DIR, file) + const ref = this.emitFile({ + type: 'asset', + name: nodePath.basename(file), + source: await fs.promises.readFile(filePath) + }) + return { file, ref } + }) + ) + return `export default {${fileRefs.map(({ file, ref }) => `\n '${file}': new URL(import.meta.ROLLUP_FILE_URL_${ref}, import.meta.url).href`).join(',')}\n}` + } } - } - })(), - styles({ - mode: 'inject', - minimize: true - }), - { - name: 'dynamic-import-polyfill', - renderDynamicImport ({ targetModuleId }): { left: string, right: string } { - // Hack for @vscode/tree-sitter-wasm that doesn't export its parser correctly (as default instead of a named export, in commonjs) - if (targetModuleId === '@vscode/tree-sitter-wasm') { + })(), + styles({ + mode: 'inject', + minimize: true + }), + { + name: 'dynamic-import-polyfill', + renderDynamicImport({ targetModuleId }): { left: string; right: string } { + // Hack for @vscode/tree-sitter-wasm that doesn't export its parser correctly (as default instead of a named export, in commonjs) + if (targetModuleId === '@vscode/tree-sitter-wasm') { + return { + left: 'import(', + right: ').then(module => ({ Parser: module.default ?? module }))' + } + } + // dynamic imports of vscode-oniguruma and vscode-textmate aren't working without it on vite return { left: 'import(', - right: ').then(module => ({ Parser: module.default ?? module }))' + right: ').then(module => module.default ?? module)' } } - // dynamic imports of vscode-oniguruma and vscode-textmate aren't working without it on vite - return { - left: 'import(', - right: ').then(module => module.default ?? module)' - } - } - }, - dynamicImportVars({ - exclude: ['**/amdX.js'] - }) - ] - }, { - // 2nd pass to improve treeshaking - cache: false, - treeshake: { - annotations: true, - preset: 'smallest', - propertyReadSideEffects: false, - tryCatchDeoptimization: true, - moduleSideEffects (id) { - return id.startsWith(DIST_DIR) || id.endsWith('.css') - } + }, + dynamicImportVars({ + exclude: ['**/amdX.js'] + }) + ] }, - external, - input: Object.fromEntries(Object.keys(input).map(f => [f, `./dist/main/${f}`])), - output: [{ - preserveModules: true, - preserveModulesRoot: 'dist/main', - minifyInternalExports: false, - assetFileNames: 'assets/[name][extname]', - format: 'esm', - dir: 'dist/main', - entryFileNames: '[name].js', - chunkFileNames: '[name].js', - hoistTransitiveImports: false - }], - plugins: [importMetaAssets({ - include: ['**/*.ts', '**/*.js'] - // assets are externals and this plugin is not able to ignore external assets - }), { - name: 'resolve-asset-url', - resolveFileUrl (options) { - let relativePath = options.relativePath - if (!relativePath.startsWith('.')) { - relativePath = `./${options.relativePath}` + { + // 2nd pass to improve treeshaking + cache: false, + treeshake: { + annotations: true, + preset: 'smallest', + propertyReadSideEffects: false, + tryCatchDeoptimization: true, + moduleSideEffects(id) { + return id.startsWith(DIST_DIR) || id.endsWith('.css') } - return `'${relativePath}'` - } - }, { - name: 'improve-treeshaking', - transform (code, id) { - if (id.includes('semver')) { - // ignore semver because it's commonjs code and rollup commonjs code generate IIFEs that this plugin will remove - return + }, + external, + input: Object.fromEntries(Object.keys(input).map((f) => [f, `./dist/main/${f}`])), + output: [ + { + preserveModules: true, + preserveModulesRoot: 'dist/main', + minifyInternalExports: false, + assetFileNames: 'assets/[name][extname]', + format: 'esm', + dir: 'dist/main', + entryFileNames: '[name].js', + chunkFileNames: '[name].js', + hoistTransitiveImports: false } - const ast = recast.parse(code, { - parser: babylonParser - }) - let transformed: boolean = false - function addComment (node: recast.types.namedTypes.NewExpression | recast.types.namedTypes.CallExpression) { - if (!(node.comments ?? []).some(comment => comment.value === PURE_ANNO)) { - transformed = true - node.comments ??= [] - node.comments.unshift(recast.types.builders.commentBlock(PURE_ANNO, true)) - return recast.types.builders.parenthesizedExpression(node) + ], + plugins: [ + importMetaAssets({ + include: ['**/*.ts', '**/*.js'] + // assets are externals and this plugin is not able to ignore external assets + }), + { + name: 'resolve-asset-url', + resolveFileUrl(options) { + let relativePath = options.relativePath + if (!relativePath.startsWith('.')) { + relativePath = `./${options.relativePath}` + } + return `'${relativePath}'` } - return node - } - recast.visit(ast.program.body, { - visitCallExpression (path) { - const node = path.node - if (node.callee.type === 'MemberExpression') { - if (node.callee.property.type === 'Identifier') { - const name = getMemberExpressionPath(node.callee) - if ((name != null && PURE_FUNCTIONS.has(name)) || PURE_FUNCTIONS.has(node.callee.property.name)) { + }, + { + name: 'improve-treeshaking', + transform(code, id) { + if (id.includes('semver')) { + // ignore semver because it's commonjs code and rollup commonjs code generate IIFEs that this plugin will remove + return + } + const ast = recast.parse(code, { + parser: babylonParser + }) + let transformed: boolean = false + function addComment( + node: recast.types.namedTypes.NewExpression | recast.types.namedTypes.CallExpression + ) { + if (!(node.comments ?? []).some((comment) => comment.value === PURE_ANNO)) { + transformed = true + node.comments ??= [] + node.comments.unshift(recast.types.builders.commentBlock(PURE_ANNO, true)) + return recast.types.builders.parenthesizedExpression(node) + } + return node + } + recast.visit(ast.program.body, { + visitCallExpression(path) { + const node = path.node + if (node.callee.type === 'MemberExpression') { + if (node.callee.property.type === 'Identifier') { + const name = getMemberExpressionPath(node.callee) + if ( + (name != null && PURE_FUNCTIONS.has(name)) || + PURE_FUNCTIONS.has(node.callee.property.name) + ) { + path.replace(addComment(node)) + } + } + } else if ( + node.callee.type === 'Identifier' && + PURE_FUNCTIONS.has(node.callee.name) + ) { path.replace(addComment(node)) + } else if (node.callee.type === 'FunctionExpression') { + const lastInstruction = node.callee.body.body[node.callee.body.body.length - 1] + const lastInstructionIsReturn = + lastInstruction?.type === 'ReturnStatement' && lastInstruction.argument != null + if (node.arguments.length > 0 || lastInstructionIsReturn) { + // heuristic: mark IIFE with parameters or with a return as pure, because typescript compile enums as IIFE + path.replace(addComment(node)) + } } + this.traverse(path) + return undefined + }, + visitThrowStatement() { + return false } - } else if (node.callee.type === 'Identifier' && PURE_FUNCTIONS.has(node.callee.name)) { - path.replace(addComment(node)) - } else if (node.callee.type === 'FunctionExpression') { - const lastInstruction = node.callee.body.body[node.callee.body.body.length - 1] - const lastInstructionIsReturn = lastInstruction?.type === 'ReturnStatement' && lastInstruction.argument != null - if (node.arguments.length > 0 || lastInstructionIsReturn) { - // heuristic: mark IIFE with parameters or with a return as pure, because typescript compile enums as IIFE - path.replace(addComment(node)) + }) + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + if (transformed) { + code = recast.print(ast).code + code = code.replace(/\/\*#__PURE__\*\/\s+/g, '/*#__PURE__*/ ') // Remove space after PURE comment + } + return code + } + }, + { + name: 'externalize-service-overrides', + resolveId(source, importer) { + const importerDir = nodePath.dirname(nodePath.resolve(DIST_DIR_MAIN, importer ?? '/')) + const resolved = nodePath.resolve(importerDir, source) + if (nodePath.dirname(resolved) === DIST_SERVICE_OVERRIDE_DIR_MAIN && importer != null) { + const serviceOverride = nodePath.basename(resolved, '.js') + return { + external: true, + id: `@codingame/monaco-vscode-${paramCase(serviceOverride)}-service-override` } } - this.traverse(path) return undefined - }, - visitThrowStatement () { - return false } - }) - // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (transformed) { - code = recast.print(ast).code - code = code.replace(/\/\*#__PURE__\*\/\s+/g, '/*#__PURE__*/ ') // Remove space after PURE comment - } - return code - } - }, - { - name: 'externalize-service-overrides', - resolveId (source, importer) { - const importerDir = nodePath.dirname(nodePath.resolve(DIST_DIR_MAIN, importer ?? '/')) - const resolved = nodePath.resolve(importerDir, source) - if (nodePath.dirname(resolved) === DIST_SERVICE_OVERRIDE_DIR_MAIN && importer != null) { - const serviceOverride = nodePath.basename(resolved, '.js') - return { - external: true, - id: `@codingame/monaco-vscode-${paramCase(serviceOverride)}-service-override` + }, + nodeResolve({ + extensions: EXTENSIONS + }), + { + name: 'cleanup', + renderChunk(code) { + return cleanup(code, null, { + comments: 'none', + sourcemap: false + }).code } - } - return undefined - } - }, - nodeResolve({ - extensions: EXTENSIONS - }), - { - name: 'cleanup', - renderChunk (code) { - return cleanup(code, null, { - comments: 'none', - sourcemap: false - }).code - } - }, - metadataPlugin({ - // generate package.json and service-override packages - getGroup (id: string, options) { - const serviceOverrideDir = nodePath.resolve(options.dir!, 'service-override') - const workersDir = nodePath.resolve(options.dir!, 'workers') + }, + metadataPlugin({ + // generate package.json and service-override packages + getGroup(id: string, options) { + const serviceOverrideDir = nodePath.resolve(options.dir!, 'service-override') + const workersDir = nodePath.resolve(options.dir!, 'workers') - if (id.startsWith(serviceOverrideDir)) { - const name = paramCase(nodePath.basename(id, '.js')) - return { - name: `service-override:${name}`, - publicName: `@codingame/monaco-vscode-${name}-service-override` - } - } - if (id.startsWith(workersDir)) { - const name = workerGroups[nodePath.basename(id, '.worker.js')] - return { - name: name != null ? `service-override:${name}` : 'main', - publicName: name != null ? `@codingame/monaco-vscode-${name}-service-override` : 'vscode' - } - } - if (id === nodePath.resolve(options.dir!, 'editor.api.js')) { - return { - name: 'editor.api', - publicName: '@codngame/monaco-vscode-editor-api' - } - } - return { - name: 'main', - publicName: 'vscode', - priority: 1 - } - }, - async handle (group, moduleGroupName, otherDependencies, options, bundle) { - if (group.name === 'main') { - // Generate package.json - const dependencies = new Set([...group.directDependencies, ...otherDependencies]) - const packageJson: PackageJson = { - ...Object.fromEntries(Object.entries(pkg).filter(([key]) => ['name', 'description', 'version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key))), - private: false, - main: 'api.js', - module: 'api.js', - exports: { - '.': { - default: './api.js' - }, - './services': { - types: './services.d.ts', - default: './services.js' - }, - './localExtensionHost': { - types: './localExtensionHost.d.ts', - default: './localExtensionHost.js' - }, - './extensions': { - types: './extensions.d.ts', - default: './extensions.js' - }, - './assets': { - types: './assets.d.ts', - default: './assets.js' - }, - './missing-services': { - default: './missing-services.js' - }, - './lifecycle': { - types: './lifecycle.d.ts', - default: './lifecycle.js' - }, - './workbench': { - default: './workbench.js' - }, - './service-override/*': { - types: './service-override/*.d.ts', - default: './service-override/*.js' - }, - './workers/*': { - default: './workers/*.js' - }, - './monaco': { - types: './monaco.d.ts', - default: './monaco.js' - }, - './l10n': { - types: './l10n.d.ts', - default: './l10n.js' - }, - './vscode/*': { - default: './vscode/src/*.js' - }, - './external/*': { - default: './external/*' + if (id.startsWith(serviceOverrideDir)) { + const name = paramCase(nodePath.basename(id, '.js')) + return { + name: `service-override:${name}`, + publicName: `@codingame/monaco-vscode-${name}-service-override` } - }, - typesVersions: { - '*': { - services: [ - './services.d.ts' - ], - extensions: [ - './extensions.d.ts' - ], - 'service-override/*': [ - './service-override/*.d.ts' - ], - monaco: [ - './monaco.d.ts' - ], - assets: [ - './assets.d.ts' - ], - lifecycle: [ - './lifecycle.d.ts' - ], - l10n: [ - './l10n.d.ts' - ], - 'vscode/*': [ - './vscode/src/*.d.ts' - ] + } + if (id.startsWith(workersDir)) { + const name = workerGroups[nodePath.basename(id, '.worker.js')] + return { + name: name != null ? `service-override:${name}` : 'main', + publicName: + name != null ? `@codingame/monaco-vscode-${name}-service-override` : 'vscode' } - }, - dependencies: { - ...Object.fromEntries(Object.entries(pkg.dependencies).filter(([key]) => dependencies.has(key))), - ...Object.fromEntries(Array.from(dependencies).filter(dep => dep.startsWith('@codingame/monaco-vscode-')).map(dep => [dep, pkg.version])) } - } - this.emitFile({ - fileName: 'package.json', - needsCodeReference: false, - source: JSON.stringify(packageJson, null, 2), - type: 'asset' - }) - } else if (group.name === 'editor.api') { - const directory = nodePath.resolve(DIST_DIR, 'editor-api') - - await fs.promises.mkdir(directory, { - recursive: true - }) - - const packageJson: PackageJson = { - name: '@codingame/monaco-vscode-editor-api', - version: '0.0.0-semantic-release', - keywords: [], - author: { - name: 'CodinGame', - url: 'http://www.codingame.com' - }, - license: 'MIT', - repository: { - type: 'git', - url: 'git+https://github.com/CodinGame/monaco-vscode-api.git' - }, - exports: { - '.': './esm/vs/editor/editor.api.js', - ...Object.fromEntries([ - 'vs/editor/editor.api', - 'vs/editor/editor.worker', - ...EDITOR_API_EXPOSE_MODULES - ].flatMap(module => { - return Object.entries({ - [`./esm/${module}`]: `./esm/${module}.js`, - [`./esm/${module}.js`]: `./esm/${module}.js` - }) - })), - './esm/vs/basic-languages/*': './empty.js', - './esm/vs/language/*': './empty.js' - }, - type: 'module', - private: false, - description: 'VSCode public API plugged on the monaco editor - monaco-editor compatible api', - main: 'esm/vs/editor/editor.api.js', - module: 'esm/vs/editor/editor.api.js', - types: 'esm/vs/editor/editor.api.d.ts', - dependencies: { - vscode: `npm:${pkg.name}@^${pkg.version}` + if (id === nodePath.resolve(options.dir!, 'editor.api.js')) { + return { + name: 'editor.api', + publicName: '@codngame/monaco-vscode-editor-api' + } } - } - const groupBundle = await rollup.rollup({ - input: { - 'esm/vs/editor/editor.api': 'entrypoint' - }, - external, - treeshake: false, - plugins: [ - nodeResolve({ - extensions: EXTENSIONS - }), { - name: 'loader', - resolveId (source, importer) { - if (source === 'entrypoint') { - return source + return { + name: 'main', + publicName: 'vscode', + priority: 1 + } + }, + async handle(group, moduleGroupName, otherDependencies, options, bundle) { + if (group.name === 'main') { + // Generate package.json + const dependencies = new Set([...group.directDependencies, ...otherDependencies]) + const packageJson: PackageJson = { + ...Object.fromEntries( + Object.entries(pkg).filter(([key]) => + [ + 'name', + 'description', + 'version', + 'keywords', + 'author', + 'license', + 'repository', + 'type' + ].includes(key) + ) + ), + private: false, + main: 'api.js', + module: 'api.js', + exports: { + '.': { + default: './api.js' + }, + './services': { + types: './services.d.ts', + default: './services.js' + }, + './localExtensionHost': { + types: './localExtensionHost.d.ts', + default: './localExtensionHost.js' + }, + './extensions': { + types: './extensions.d.ts', + default: './extensions.js' + }, + './assets': { + types: './assets.d.ts', + default: './assets.js' + }, + './missing-services': { + default: './missing-services.js' + }, + './lifecycle': { + types: './lifecycle.d.ts', + default: './lifecycle.js' + }, + './workbench': { + default: './workbench.js' + }, + './service-override/*': { + types: './service-override/*.d.ts', + default: './service-override/*.js' + }, + './workers/*': { + default: './workers/*.js' + }, + './monaco': { + types: './monaco.d.ts', + default: './monaco.js' + }, + './l10n': { + types: './l10n.d.ts', + default: './l10n.js' + }, + './vscode/*': { + default: './vscode/src/*.js' + }, + './external/*': { + default: './external/*' } - if (source.startsWith('@codingame/monaco-vscode-')) { - return { - external: true, - id: source - } + }, + typesVersions: { + '*': { + services: ['./services.d.ts'], + extensions: ['./extensions.d.ts'], + 'service-override/*': ['./service-override/*.d.ts'], + monaco: ['./monaco.d.ts'], + assets: ['./assets.d.ts'], + lifecycle: ['./lifecycle.d.ts'], + l10n: ['./l10n.d.ts'], + 'vscode/*': ['./vscode/src/*.d.ts'] } - const importerDir = nodePath.dirname(nodePath.resolve(DIST_DIR_MAIN, importer ?? '/')) - const resolved = nodePath.resolve(importerDir, source) - const resolvedWithExtension = resolved.endsWith('.js') ? resolved : `${resolved}.js` + }, + dependencies: { + ...Object.fromEntries( + Object.entries(pkg.dependencies).filter(([key]) => dependencies.has(key)) + ), + ...Object.fromEntries( + Array.from(dependencies) + .filter((dep) => dep.startsWith('@codingame/monaco-vscode-')) + .map((dep) => [dep, pkg.version]) + ) + } + } + this.emitFile({ + fileName: 'package.json', + needsCodeReference: false, + source: JSON.stringify(packageJson, null, 2), + type: 'asset' + }) + } else if (group.name === 'editor.api') { + const directory = nodePath.resolve(DIST_DIR, 'editor-api') - const isVscodeFile = resolved.startsWith(VSCODE_SRC_DIST_DIR) - const isServiceOverride = nodePath.dirname(resolved) === DIST_SERVICE_OVERRIDE_DIR_MAIN - const isExclusive = group.exclusiveModules.has(resolvedWithExtension) - const pathFromRoot = nodePath.relative(DIST_DIR_MAIN, resolvedWithExtension) - const shouldBeShared = SHARED_ROOT_FILES_BETWEEN_PACKAGES.includes(nodePath.relative(DIST_DIR_MAIN, resolvedWithExtension)) - if (pathFromRoot.startsWith('external/') && !isExclusive) { - return { - external: true, - id: `vscode/${pathFromRoot}` - } - } - if (((isVscodeFile || isServiceOverride) && !isExclusive) || shouldBeShared) { - function getPackageFromGroupName (groupName: string) { - if (groupName === 'main') { - return 'vscode' - } - const [_, category, name] = /^(.*):(.*)$/.exec(groupName)! - return `@codingame/monaco-vscode-${name}-${category}` - } - const importFromGroup = isVscodeFile ? moduleGroupName.get(resolved) ?? 'main' : 'main' - const importFromModule = getPackageFromGroupName(importFromGroup) - // Those modules will be imported from external monaco-vscode-api - let externalResolved = resolved.startsWith(VSCODE_SRC_DIST_DIR) ? `${importFromModule}/vscode/${nodePath.relative(VSCODE_SRC_DIST_DIR, resolved)}` : `${importFromModule}/${nodePath.relative(DIST_DIR_MAIN, resolved)}` - if (externalResolved.endsWith('.js')) { - externalResolved = externalResolved.slice(0, -3) - } - return { - id: externalResolved, - external: true - } - } + await fs.promises.mkdir(directory, { + recursive: true + }) - return undefined + const packageJson: PackageJson = { + name: '@codingame/monaco-vscode-editor-api', + version: '0.0.0-semantic-release', + keywords: [], + author: { + name: 'CodinGame', + url: 'http://www.codingame.com' }, - load (id) { - if (id === 'entrypoint') { - return `export * from '${Array.from(group.entrypoints)[0]!.slice(0, -3)}'` - } - if (id.startsWith('vscode/')) { - return (bundle[nodePath.relative('vscode', id)] as rollup.OutputChunk | undefined)?.code - } - return (bundle[nodePath.relative(DIST_DIR_MAIN, id)] as rollup.OutputChunk | undefined)?.code + license: 'MIT', + repository: { + type: 'git', + url: 'git+https://github.com/CodinGame/monaco-vscode-api.git' }, - resolveFileUrl (options) { - let relativePath = options.relativePath - if (!relativePath.startsWith('.')) { - relativePath = `./${options.relativePath}` - } - return `'${relativePath}'` - }, - generateBundle () { - this.emitFile({ - fileName: 'package.json', - needsCodeReference: false, - source: JSON.stringify(packageJson, null, 2), - type: 'asset' - }) - for (const modulePath of EDITOR_API_EXPOSE_MODULES) { - // make sure file exists - fs.statSync(nodePath.resolve(VSCODE_SRC_DIR, `${modulePath}.js`)) - this.emitFile({ - fileName: `esm/${modulePath}.js`, - needsCodeReference: false, - source: `export * from 'vscode/vscode/${modulePath}'`, - type: 'asset' + exports: { + '.': './esm/vs/editor/editor.api.js', + ...Object.fromEntries( + [ + 'vs/editor/editor.api', + 'vs/editor/editor.worker', + ...EDITOR_API_EXPOSE_MODULES + ].flatMap((module) => { + return Object.entries({ + [`./esm/${module}`]: `./esm/${module}.js`, + [`./esm/${module}.js`]: `./esm/${module}.js` + }) }) - } - this.emitFile({ - fileName: 'esm/vs/editor/editor.worker.js', - needsCodeReference: false, - source: "export * from 'vscode/workers/editor.worker'", - type: 'asset' - }) - this.emitFile({ - fileName: 'empty.js', - needsCodeReference: false, - source: 'export {}', - type: 'asset' - }) + ), + './esm/vs/basic-languages/*': './empty.js', + './esm/vs/language/*': './empty.js' + }, + type: 'module', + private: false, + description: + 'VSCode public API plugged on the monaco editor - monaco-editor compatible api', + main: 'esm/vs/editor/editor.api.js', + module: 'esm/vs/editor/editor.api.js', + types: 'esm/vs/editor/editor.api.d.ts', + dependencies: { + vscode: `npm:${pkg.name}@^${pkg.version}` } - }] - }) - await groupBundle.write({ - minifyInternalExports: false, - format: 'esm', - dir: directory, - entryFileNames: '[name].js', - chunkFileNames: '[name].js', - hoistTransitiveImports: false - }) - await groupBundle.close() - // remove exclusive files from main bundle to prevent them from being duplicated - for (const exclusiveModule of group.exclusiveModules) { - delete bundle[nodePath.relative(DIST_DIR_MAIN, exclusiveModule)] - } - } else { - const [_, category, name] = /^(.*):(.*)$/.exec(group.name)! - - const directory = nodePath.resolve(DIST_DIR, `${category}-${name}`) + } + const groupBundle = await rollup.rollup({ + input: { + 'esm/vs/editor/editor.api': 'entrypoint' + }, + external, + treeshake: false, + plugins: [ + nodeResolve({ + extensions: EXTENSIONS + }), + { + name: 'loader', + resolveId(source, importer) { + if (source === 'entrypoint') { + return source + } + if (source.startsWith('@codingame/monaco-vscode-')) { + return { + external: true, + id: source + } + } + const importerDir = nodePath.dirname( + nodePath.resolve(DIST_DIR_MAIN, importer ?? '/') + ) + const resolved = nodePath.resolve(importerDir, source) + const resolvedWithExtension = resolved.endsWith('.js') + ? resolved + : `${resolved}.js` - await fs.promises.mkdir(directory, { - recursive: true - }) - const serviceOverrideEntryPoint = Array.from(group.entrypoints).find(e => e.includes('/service-override/'))! - const workerEntryPoint = Array.from(group.entrypoints).find(e => e.includes('/workers/')) + const isVscodeFile = resolved.startsWith(VSCODE_SRC_DIST_DIR) + const isServiceOverride = + nodePath.dirname(resolved) === DIST_SERVICE_OVERRIDE_DIR_MAIN + const isExclusive = group.exclusiveModules.has(resolvedWithExtension) + const pathFromRoot = nodePath.relative(DIST_DIR_MAIN, resolvedWithExtension) + const shouldBeShared = SHARED_ROOT_FILES_BETWEEN_PACKAGES.includes( + nodePath.relative(DIST_DIR_MAIN, resolvedWithExtension) + ) + if (pathFromRoot.startsWith('external/') && !isExclusive) { + return { + external: true, + id: `vscode/${pathFromRoot}` + } + } + if (((isVscodeFile || isServiceOverride) && !isExclusive) || shouldBeShared) { + function getPackageFromGroupName(groupName: string) { + if (groupName === 'main') { + return 'vscode' + } + const [_, category, name] = /^(.*):(.*)$/.exec(groupName)! + return `@codingame/monaco-vscode-${name}-${category}` + } + const importFromGroup = isVscodeFile + ? (moduleGroupName.get(resolved) ?? 'main') + : 'main' + const importFromModule = getPackageFromGroupName(importFromGroup) + // Those modules will be imported from external monaco-vscode-api + let externalResolved = resolved.startsWith(VSCODE_SRC_DIST_DIR) + ? `${importFromModule}/vscode/${nodePath.relative(VSCODE_SRC_DIST_DIR, resolved)}` + : `${importFromModule}/${nodePath.relative(DIST_DIR_MAIN, resolved)}` + if (externalResolved.endsWith('.js')) { + externalResolved = externalResolved.slice(0, -3) + } + return { + id: externalResolved, + external: true + } + } - const packageJson: PackageJson = { - name: `@codingame/monaco-vscode-${name}-${category}`, - ...Object.fromEntries(Object.entries(pkg).filter(([key]) => ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key))), - private: false, - description: `${pkg.description} - ${name} ${category}`, - main: 'index.js', - module: 'index.js', - types: 'index.d.ts', - exports: { - '.': { - default: './index.js' - }, - './vscode/*': { - default: './vscode/src/*.js' - }, - ...(workerEntryPoint != null - ? { - './worker': { - default: './worker.js' + return undefined + }, + load(id) { + if (id === 'entrypoint') { + return `export * from '${Array.from(group.entrypoints)[0]!.slice(0, -3)}'` + } + if (id.startsWith('vscode/')) { + return ( + bundle[nodePath.relative('vscode', id)] as rollup.OutputChunk | undefined + )?.code + } + return ( + bundle[nodePath.relative(DIST_DIR_MAIN, id)] as + | rollup.OutputChunk + | undefined + )?.code + }, + resolveFileUrl(options) { + let relativePath = options.relativePath + if (!relativePath.startsWith('.')) { + relativePath = `./${options.relativePath}` + } + return `'${relativePath}'` + }, + generateBundle() { + this.emitFile({ + fileName: 'package.json', + needsCodeReference: false, + source: JSON.stringify(packageJson, null, 2), + type: 'asset' + }) + for (const modulePath of EDITOR_API_EXPOSE_MODULES) { + // make sure file exists + fs.statSync(nodePath.resolve(VSCODE_SRC_DIR, `${modulePath}.js`)) + this.emitFile({ + fileName: `esm/${modulePath}.js`, + needsCodeReference: false, + source: `export * from 'vscode/vscode/${modulePath}'`, + type: 'asset' + }) + } + this.emitFile({ + fileName: 'esm/vs/editor/editor.worker.js', + needsCodeReference: false, + source: "export * from 'vscode/workers/editor.worker'", + type: 'asset' + }) + this.emitFile({ + fileName: 'empty.js', + needsCodeReference: false, + source: 'export {}', + type: 'asset' + }) } } - : {}) - }, - dependencies: { - vscode: `npm:${pkg.name}@^${pkg.version}`, - ...Object.fromEntries(Object.entries(pkg.dependencies).filter(([key]) => group.directDependencies.has(key))), - ...Object.fromEntries(Array.from(group.directDependencies).filter(dep => dep.startsWith('@codingame/monaco-vscode-')).map(dep => [dep, pkg.version])) - } - } + ] + }) + await groupBundle.write({ + minifyInternalExports: false, + format: 'esm', + dir: directory, + entryFileNames: '[name].js', + chunkFileNames: '[name].js', + hoistTransitiveImports: false + }) + await groupBundle.close() + // remove exclusive files from main bundle to prevent them from being duplicated + for (const exclusiveModule of group.exclusiveModules) { + delete bundle[nodePath.relative(DIST_DIR_MAIN, exclusiveModule)] + } + } else { + const [_, category, name] = /^(.*):(.*)$/.exec(group.name)! - const entrypointInfo = this.getModuleInfo(serviceOverrideEntryPoint)! + const directory = nodePath.resolve(DIST_DIR, `${category}-${name}`) - const groupBundle = await rollup.rollup({ - input: { - index: 'entrypoint', - ...(workerEntryPoint != null - ? { - worker: 'worker' - } - : {}) - }, - external, - treeshake: false, - plugins: [ - importMetaAssets({ - include: ['**/*.ts', '**/*.js'] - // assets are externals and this plugin is not able to ignore external assets - }), - nodeResolve({ - extensions: EXTENSIONS - }), { - name: 'loader', - resolveId (source, importer) { - if (source === 'entrypoint' || source === 'worker') { - return source - } - if (source.startsWith('@codingame/monaco-vscode-')) { - return { - external: true, - id: source - } - } - const importerDir = nodePath.dirname(nodePath.resolve(DIST_DIR_MAIN, importer ?? '/')) - const resolved = nodePath.resolve(importerDir, source) - const resolvedWithExtension = resolved.endsWith('.js') ? resolved : `${resolved}.js` - - const isVscodeFile = resolved.startsWith(VSCODE_SRC_DIST_DIR) - const isServiceOverride = nodePath.dirname(resolved) === DIST_SERVICE_OVERRIDE_DIR_MAIN - const isExclusive = group.exclusiveModules.has(resolvedWithExtension) - const pathFromRoot = nodePath.relative(DIST_DIR_MAIN, resolvedWithExtension) - const shouldBeShared = SHARED_ROOT_FILES_BETWEEN_PACKAGES.includes(nodePath.relative(DIST_DIR_MAIN, resolvedWithExtension)) - if (pathFromRoot.startsWith('external/') && !isExclusive) { - return { - external: true, - id: `vscode/${pathFromRoot}` - } - } + await fs.promises.mkdir(directory, { + recursive: true + }) + const serviceOverrideEntryPoint = Array.from(group.entrypoints).find((e) => + e.includes('/service-override/') + )! + const workerEntryPoint = Array.from(group.entrypoints).find((e) => + e.includes('/workers/') + ) - if (((isVscodeFile || isServiceOverride) && !isExclusive) || shouldBeShared) { - function getPackageFromGroupName (groupName: string) { - if (groupName === 'main') { - return 'vscode' + const packageJson: PackageJson = { + name: `@codingame/monaco-vscode-${name}-${category}`, + ...Object.fromEntries( + Object.entries(pkg).filter(([key]) => + ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key) + ) + ), + private: false, + description: `${pkg.description} - ${name} ${category}`, + main: 'index.js', + module: 'index.js', + types: 'index.d.ts', + exports: { + '.': { + default: './index.js' + }, + './vscode/*': { + default: './vscode/src/*.js' + }, + ...(workerEntryPoint != null + ? { + './worker': { + default: './worker.js' + } } - const [_, category, name] = /^(.*):(.*)$/.exec(groupName)! - return `@codingame/monaco-vscode-${name}-${category}` - } - const importFromGroup = isVscodeFile ? moduleGroupName.get(resolved) ?? 'main' : 'main' - const importFromModule = getPackageFromGroupName(importFromGroup) - // Those modules will be imported from external monaco-vscode-api - let externalResolved = resolved.startsWith(VSCODE_SRC_DIST_DIR) ? `${importFromModule}/vscode/${nodePath.relative(VSCODE_SRC_DIST_DIR, resolved)}` : `${importFromModule}/${nodePath.relative(DIST_DIR_MAIN, resolved)}` - if (externalResolved.endsWith('.js')) { - externalResolved = externalResolved.slice(0, -3) - } - return { - id: externalResolved, - external: true - } - } + : {}) + }, + dependencies: { + vscode: `npm:${pkg.name}@^${pkg.version}`, + ...Object.fromEntries( + Object.entries(pkg.dependencies).filter(([key]) => + group.directDependencies.has(key) + ) + ), + ...Object.fromEntries( + Array.from(group.directDependencies) + .filter((dep) => dep.startsWith('@codingame/monaco-vscode-')) + .map((dep) => [dep, pkg.version]) + ) + } + } - return undefined + const entrypointInfo = this.getModuleInfo(serviceOverrideEntryPoint)! + + const groupBundle = await rollup.rollup({ + input: { + index: 'entrypoint', + ...(workerEntryPoint != null + ? { + worker: 'worker' + } + : {}) }, - load (id) { - if (id === 'entrypoint') { - const codeLines: string[] = [] - if ((entrypointInfo.exports ?? []).includes('default')) { - codeLines.push(`export { default } from '${serviceOverrideEntryPoint.slice(0, -3)}'`) - } - if ((entrypointInfo.exports ?? []).some(e => e !== 'default')) { - codeLines.push(`export * from '${serviceOverrideEntryPoint.slice(0, -3)}'`) - } - if ((entrypointInfo.exports ?? []).length === 0) { - codeLines.push(`import '${serviceOverrideEntryPoint.slice(0, -3)}'`) + external, + treeshake: false, + plugins: [ + importMetaAssets({ + include: ['**/*.ts', '**/*.js'] + // assets are externals and this plugin is not able to ignore external assets + }), + nodeResolve({ + extensions: EXTENSIONS + }), + { + name: 'loader', + resolveId(source, importer) { + if (source === 'entrypoint' || source === 'worker') { + return source + } + if (source.startsWith('@codingame/monaco-vscode-')) { + return { + external: true, + id: source + } + } + const importerDir = nodePath.dirname( + nodePath.resolve(DIST_DIR_MAIN, importer ?? '/') + ) + const resolved = nodePath.resolve(importerDir, source) + const resolvedWithExtension = resolved.endsWith('.js') + ? resolved + : `${resolved}.js` + + const isVscodeFile = resolved.startsWith(VSCODE_SRC_DIST_DIR) + const isServiceOverride = + nodePath.dirname(resolved) === DIST_SERVICE_OVERRIDE_DIR_MAIN + const isExclusive = group.exclusiveModules.has(resolvedWithExtension) + const pathFromRoot = nodePath.relative(DIST_DIR_MAIN, resolvedWithExtension) + const shouldBeShared = SHARED_ROOT_FILES_BETWEEN_PACKAGES.includes( + nodePath.relative(DIST_DIR_MAIN, resolvedWithExtension) + ) + if (pathFromRoot.startsWith('external/') && !isExclusive) { + return { + external: true, + id: `vscode/${pathFromRoot}` + } + } + + if (((isVscodeFile || isServiceOverride) && !isExclusive) || shouldBeShared) { + function getPackageFromGroupName(groupName: string) { + if (groupName === 'main') { + return 'vscode' + } + const [_, category, name] = /^(.*):(.*)$/.exec(groupName)! + return `@codingame/monaco-vscode-${name}-${category}` + } + const importFromGroup = isVscodeFile + ? (moduleGroupName.get(resolved) ?? 'main') + : 'main' + const importFromModule = getPackageFromGroupName(importFromGroup) + // Those modules will be imported from external monaco-vscode-api + let externalResolved = resolved.startsWith(VSCODE_SRC_DIST_DIR) + ? `${importFromModule}/vscode/${nodePath.relative(VSCODE_SRC_DIST_DIR, resolved)}` + : `${importFromModule}/${nodePath.relative(DIST_DIR_MAIN, resolved)}` + if (externalResolved.endsWith('.js')) { + externalResolved = externalResolved.slice(0, -3) + } + return { + id: externalResolved, + external: true + } + } + + return undefined + }, + load(id) { + if (id === 'entrypoint') { + const codeLines: string[] = [] + if ((entrypointInfo.exports ?? []).includes('default')) { + codeLines.push( + `export { default } from '${serviceOverrideEntryPoint.slice(0, -3)}'` + ) + } + if ((entrypointInfo.exports ?? []).some((e) => e !== 'default')) { + codeLines.push( + `export * from '${serviceOverrideEntryPoint.slice(0, -3)}'` + ) + } + if ((entrypointInfo.exports ?? []).length === 0) { + codeLines.push(`import '${serviceOverrideEntryPoint.slice(0, -3)}'`) + } + return codeLines.join('\n') + } + if (id === 'worker') { + return `import '${workerEntryPoint}'` + } + if (id.startsWith('vscode/')) { + return ( + bundle[nodePath.relative('vscode', id)] as rollup.OutputChunk | undefined + )?.code + } + return ( + bundle[nodePath.relative(DIST_DIR_MAIN, id)] as + | rollup.OutputChunk + | undefined + )?.code + }, + resolveFileUrl(options) { + let relativePath = options.relativePath + if (!relativePath.startsWith('.')) { + relativePath = `./${options.relativePath}` + } + return `'${relativePath}'` + }, + generateBundle() { + this.emitFile({ + fileName: 'package.json', + needsCodeReference: false, + source: JSON.stringify(packageJson, null, 2), + type: 'asset' + }) } - return codeLines.join('\n') - } - if (id === 'worker') { - return `import '${workerEntryPoint}'` } - if (id.startsWith('vscode/')) { - return (bundle[nodePath.relative('vscode', id)] as rollup.OutputChunk | undefined)?.code - } - return (bundle[nodePath.relative(DIST_DIR_MAIN, id)] as rollup.OutputChunk | undefined)?.code - }, - resolveFileUrl (options) { - let relativePath = options.relativePath - if (!relativePath.startsWith('.')) { - relativePath = `./${options.relativePath}` - } - return `'${relativePath}'` - }, - generateBundle () { - this.emitFile({ - fileName: 'package.json', - needsCodeReference: false, - source: JSON.stringify(packageJson, null, 2), - type: 'asset' - }) - } - }] - }) - const output = await groupBundle.write({ - preserveModules: true, - preserveModulesRoot: nodePath.resolve(DIST_DIR, 'main/service-override'), - minifyInternalExports: false, - assetFileNames: 'assets/[name][extname]', - format: 'esm', - dir: directory, - entryFileNames: '[name].js', - chunkFileNames: '[name].js', - hoistTransitiveImports: false - }) - await groupBundle.close() + ] + }) + const output = await groupBundle.write({ + preserveModules: true, + preserveModulesRoot: nodePath.resolve(DIST_DIR, 'main/service-override'), + minifyInternalExports: false, + assetFileNames: 'assets/[name][extname]', + format: 'esm', + dir: directory, + entryFileNames: '[name].js', + chunkFileNames: '[name].js', + hoistTransitiveImports: false + }) + await groupBundle.close() - // remove exclusive files from main bundle to prevent them from being duplicated - for (const exclusiveModule of group.exclusiveModules) { - delete bundle[nodePath.relative(DIST_DIR_MAIN, exclusiveModule)] - } + // remove exclusive files from main bundle to prevent them from being duplicated + for (const exclusiveModule of group.exclusiveModules) { + delete bundle[nodePath.relative(DIST_DIR_MAIN, exclusiveModule)] + } - const assets = output.output - .filter((file): file is rollup.OutputAsset => file.type === 'asset') - .filter(file => file.fileName !== 'package.json') - for (const asset of assets) { - delete bundle[asset.fileName] + const assets = output.output + .filter((file): file is rollup.OutputAsset => file.type === 'asset') + .filter((file) => file.fileName !== 'package.json') + for (const asset of assets) { + delete bundle[asset.fileName] + } + } } - } - } - }), { - name: 'clean-src', - async generateBundle () { - // Delete intermediate sources before writing to make sure there is no unused files - await fs.promises.rm(DIST_DIR_MAIN, { - recursive: true + }), + { + name: 'clean-src', + async generateBundle() { + // Delete intermediate sources before writing to make sure there is no unused files + await fs.promises.rm(DIST_DIR_MAIN, { + recursive: true + }) + } + }, + copy({ + hook: 'generateBundle', + targets: [{ src: ['README.md'], dest: 'dist/main' }] }) - } - }, - copy({ - hook: 'generateBundle', - targets: [ - { src: ['README.md'], dest: 'dist/main' } ] - }) - ] - }]) + } + ]) } -function resolve (_path: string, fromPaths: string[]) { +function resolve(_path: string, fromPaths: string[]) { for (const fromPath of fromPaths) { for (const extension of EXTENSIONS) { const outputPath = nodePath.resolve(fromPath, `${_path}${extension}`) diff --git a/rollup/rollup.default-extensions.ts b/rollup/rollup.default-extensions.ts index fff475f0..65cce116 100644 --- a/rollup/rollup.default-extensions.ts +++ b/rollup/rollup.default-extensions.ts @@ -17,9 +17,14 @@ const EXTENSIONS = ['', '.ts', '.js'] const BASE_DIR = path.resolve(__dirname, '..') const DEFAULT_EXTENSIONS_PATH = path.resolve(BASE_DIR, 'vscode-default-extensions') -const defaultExtensions = fs.readdirSync(DEFAULT_EXTENSIONS_PATH, { withFileTypes: true }) - .filter(f => f.isDirectory() && fs.existsSync(path.resolve(DEFAULT_EXTENSIONS_PATH, f.name, 'package.json'))) - .map(f => f.name) +const defaultExtensions = fs + .readdirSync(DEFAULT_EXTENSIONS_PATH, { withFileTypes: true }) + .filter( + (f) => + f.isDirectory() && + fs.existsSync(path.resolve(DEFAULT_EXTENSIONS_PATH, f.name, 'package.json')) + ) + .map((f) => f.name) const languageGrammarExtensions: string[] = [] const languageFeatureExtensions: string[] = [] @@ -35,158 +40,192 @@ for (const extension of defaultExtensions) { } export default rollup.defineConfig([ - ...defaultExtensions.map(name => ({ - input: path.resolve(DEFAULT_EXTENSIONS_PATH, name), - output: [{ - minifyInternalExports: false, - assetFileNames: chunkInfo => { - if (chunkInfo.name != null && (chunkInfo.name.endsWith('d.ts') || chunkInfo.name.endsWith('.css'))) { - // append .txt at the end of d.ts and css files: those file are expected to be loaded as simple text while some bundlers like vite tries to transform them - return 'resources/[name][extname].txt' - } - return 'resources/[name][extname]' - }, - format: 'esm', - dir: `dist/default-extension-${name}`, - entryFileNames: 'index.js', - chunkFileNames: '[name].js', - hoistTransitiveImports: false - }], - external (source) { - return source === 'vscode/extensions' - }, - plugins: [ - { - name: 'resolve-asset-url', - resolveFileUrl (options) { - let relativePath = options.relativePath - if (!relativePath.startsWith('.')) { - relativePath = `./${options.relativePath}` - } - return `'${relativePath}'` - } - }, - nodeResolve({ - extensions: EXTENSIONS - }), - importMetaAssets(), - { - name: 'dynamic-import-polyfill', - renderDynamicImport (): { left: string, right: string } { - return { - left: 'import(', - right: ').then(module => module.default ?? module)' - } - } - }, - extensionDirectoryPlugin({ - include: `${DEFAULT_EXTENSIONS_PATH}/**/*`, - transformManifest (manifest) { - return { - ...manifest, - main: undefined + ...defaultExtensions.map( + (name) => + { + input: path.resolve(DEFAULT_EXTENSIONS_PATH, name), + output: [ + { + minifyInternalExports: false, + assetFileNames: (chunkInfo) => { + if ( + chunkInfo.name != null && + (chunkInfo.name.endsWith('d.ts') || chunkInfo.name.endsWith('.css')) + ) { + // append .txt at the end of d.ts and css files: those file are expected to be loaded as simple text while some bundlers like vite tries to transform them + return 'resources/[name][extname].txt' + } + return 'resources/[name][extname]' + }, + format: 'esm', + dir: `dist/default-extension-${name}`, + entryFileNames: 'index.js', + chunkFileNames: '[name].js', + hoistTransitiveImports: false } - } - }), - metadataPlugin({ - handle ({ directDependencies }, moduleGroupName, otherDependencies, options, bundle) { - const entrypoint = Object.values(bundle).filter(v => (v as rollup.OutputChunk).isEntry)[0]!.fileName - const packageJson: PackageJson = { - name: `@codingame/monaco-vscode-${name}-default-extension`, - ...Object.fromEntries(Object.entries(pkg).filter(([key]) => ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key))), - private: false, - description: `Default VSCode extension designed to be used with ${pkg.name}`, - main: entrypoint, - module: entrypoint, - types: 'index.d.ts', - dependencies: { - vscode: `npm:${pkg.name}@^${pkg.version}`, - ...Object.fromEntries(Object.entries(pkg.dependencies).filter(([key]) => directDependencies.has(key))) + ], + external(source) { + return source === 'vscode/extensions' + }, + plugins: [ + { + name: 'resolve-asset-url', + resolveFileUrl(options) { + let relativePath = options.relativePath + if (!relativePath.startsWith('.')) { + relativePath = `./${options.relativePath}` + } + return `'${relativePath}'` } - } + }, + nodeResolve({ + extensions: EXTENSIONS + }), + importMetaAssets(), + { + name: 'dynamic-import-polyfill', + renderDynamicImport(): { left: string; right: string } { + return { + left: 'import(', + right: ').then(module => module.default ?? module)' + } + } + }, + extensionDirectoryPlugin({ + include: `${DEFAULT_EXTENSIONS_PATH}/**/*`, + transformManifest(manifest) { + return { + ...manifest, + main: undefined + } + } + }), + metadataPlugin({ + handle({ directDependencies }, moduleGroupName, otherDependencies, options, bundle) { + const entrypoint = Object.values(bundle).filter( + (v) => (v as rollup.OutputChunk).isEntry + )[0]!.fileName + const packageJson: PackageJson = { + name: `@codingame/monaco-vscode-${name}-default-extension`, + ...Object.fromEntries( + Object.entries(pkg).filter(([key]) => + ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key) + ) + ), + private: false, + description: `Default VSCode extension designed to be used with ${pkg.name}`, + main: entrypoint, + module: entrypoint, + types: 'index.d.ts', + dependencies: { + vscode: `npm:${pkg.name}@^${pkg.version}`, + ...Object.fromEntries( + Object.entries(pkg.dependencies).filter(([key]) => directDependencies.has(key)) + ) + } + } - this.emitFile({ - fileName: 'package.json', - needsCodeReference: false, - source: JSON.stringify(packageJson, null, 2), - type: 'asset' - }) + this.emitFile({ + fileName: 'package.json', + needsCodeReference: false, + source: JSON.stringify(packageJson, null, 2), + type: 'asset' + }) - this.emitFile({ - fileName: 'index.d.ts', - needsCodeReference: false, - source: 'declare const whenReady: () => Promise\nexport { whenReady }', - type: 'asset' + this.emitFile({ + fileName: 'index.d.ts', + needsCodeReference: false, + source: 'declare const whenReady: () => Promise\nexport { whenReady }', + type: 'asset' + }) + } }) - } - }) - ] - })), ...[{ - name: '@codingame/monaco-vscode-all-default-extensions', - directory: 'default-extension-all', - extensions: defaultExtensions - }, { - name: '@codingame/monaco-vscode-all-language-default-extensions', - directory: 'default-extension-all-languages', - extensions: languageGrammarExtensions - }, { - name: '@codingame/monaco-vscode-all-language-feature-default-extensions', - directory: 'default-extension-all-language-features', - extensions: languageFeatureExtensions - }].map(({ name, directory, extensions }) => ({ - input: 'index.js', - output: [{ - format: 'esm', - dir: 'dist/' + directory, - entryFileNames: 'index.js' - }], - external () { - return true + ] + } + ), + ...[ + { + name: '@codingame/monaco-vscode-all-default-extensions', + directory: 'default-extension-all', + extensions: defaultExtensions }, - plugins: [{ - name: 'code-loader', - resolveId () { - return 'index.js' - }, - load () { - return ` -${extensions.map(name => `import { whenReady as whenReady${pascalCase(name)} } from '@codingame/monaco-vscode-${name}-default-extension'`).join('\n')} + { + name: '@codingame/monaco-vscode-all-language-default-extensions', + directory: 'default-extension-all-languages', + extensions: languageGrammarExtensions + }, + { + name: '@codingame/monaco-vscode-all-language-feature-default-extensions', + directory: 'default-extension-all-language-features', + extensions: languageFeatureExtensions + } + ].map( + ({ name, directory, extensions }) => + { + input: 'index.js', + output: [ + { + format: 'esm', + dir: 'dist/' + directory, + entryFileNames: 'index.js' + } + ], + external() { + return true + }, + plugins: [ + { + name: 'code-loader', + resolveId() { + return 'index.js' + }, + load() { + return ` +${extensions.map((name) => `import { whenReady as whenReady${pascalCase(name)} } from '@codingame/monaco-vscode-${name}-default-extension'`).join('\n')} const whenReady = Promise.all([ -${extensions.map(name => ` whenReady${pascalCase(name)}()`).join(',\n')} +${extensions.map((name) => ` whenReady${pascalCase(name)}()`).join(',\n')} ]) ` - } - }, - metadataPlugin({ - handle ({ directDependencies }, moduleGroupName, otherDependencies, options, bundle) { - const entrypoint = Object.values(bundle).filter(v => (v as rollup.OutputChunk).isEntry)[0]!.fileName - const packageJson: PackageJson = { - name, - ...Object.fromEntries(Object.entries(pkg).filter(([key]) => ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key))), - private: false, - description: `Meta package including default VSCode extensions designed to be used with ${pkg.name}`, - main: entrypoint, - module: entrypoint, - types: 'index.d.ts', - dependencies: Object.fromEntries(Array.from(directDependencies).map(name => [ - name, - pkg.version - ])) - } + } + }, + metadataPlugin({ + handle({ directDependencies }, moduleGroupName, otherDependencies, options, bundle) { + const entrypoint = Object.values(bundle).filter( + (v) => (v as rollup.OutputChunk).isEntry + )[0]!.fileName + const packageJson: PackageJson = { + name, + ...Object.fromEntries( + Object.entries(pkg).filter(([key]) => + ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key) + ) + ), + private: false, + description: `Meta package including default VSCode extensions designed to be used with ${pkg.name}`, + main: entrypoint, + module: entrypoint, + types: 'index.d.ts', + dependencies: Object.fromEntries( + Array.from(directDependencies).map((name) => [name, pkg.version]) + ) + } - this.emitFile({ - fileName: 'package.json', - needsCodeReference: false, - source: JSON.stringify(packageJson, null, 2), - type: 'asset' - }) + this.emitFile({ + fileName: 'package.json', + needsCodeReference: false, + source: JSON.stringify(packageJson, null, 2), + type: 'asset' + }) - this.emitFile({ - fileName: 'index.d.ts', - needsCodeReference: false, - source: 'declare const whenReady: () => Promise\nexport { whenReady }', - type: 'asset' - }) + this.emitFile({ + fileName: 'index.d.ts', + needsCodeReference: false, + source: 'declare const whenReady: () => Promise\nexport { whenReady }', + type: 'asset' + }) + } + }) + ] } - })] - }))]) + ) +]) diff --git a/rollup/rollup.language-packs.ts b/rollup/rollup.language-packs.ts index 0c625d1c..6ac20628 100644 --- a/rollup/rollup.language-packs.ts +++ b/rollup/rollup.language-packs.ts @@ -17,120 +17,147 @@ const BASE_DIR = path.resolve(__dirname, '..') const LOC_PATH = path.resolve(BASE_DIR, 'vscode-loc') const DIST_DIR = path.resolve(BASE_DIR, 'dist') -const locExtensions = fs.readdirSync(LOC_PATH, { withFileTypes: true }) - .filter(f => f.isDirectory() && fs.existsSync(path.resolve(LOC_PATH, f.name, 'package.json'))) - .map(f => f.name) +const locExtensions = fs + .readdirSync(LOC_PATH, { withFileTypes: true }) + .filter((f) => f.isDirectory() && fs.existsSync(path.resolve(LOC_PATH, f.name, 'package.json'))) + .map((f) => f.name) -const nlsKeys: [string, string[]][] = JSON.parse((await fs.promises.readFile(path.resolve(DIST_DIR, 'nls.keys.json'))).toString()) +const nlsKeys: [string, string[]][] = JSON.parse( + (await fs.promises.readFile(path.resolve(DIST_DIR, 'nls.keys.json'))).toString() +) export default rollup.defineConfig([ - ...locExtensions.map(name => ({ - input: { - index: path.resolve(LOC_PATH, name) - }, - output: [{ - minifyInternalExports: false, - preserveModules: true, - assetFileNames: '[name][extname]', - format: 'esm', - dir: `dist/${name}`, - entryFileNames: '[name].js', - hoistTransitiveImports: false - }], - external (source) { - return source === 'vscode/l10n' - }, - plugins: [ - { - name: 'resolve-asset-url', - resolveFileUrl (options) { - let relativePath = options.relativePath - if (!relativePath.startsWith('.')) { - relativePath = `./${options.relativePath}` + ...locExtensions.map( + (name) => + { + input: { + index: path.resolve(LOC_PATH, name) + }, + output: [ + { + minifyInternalExports: false, + preserveModules: true, + assetFileNames: '[name][extname]', + format: 'esm', + dir: `dist/${name}`, + entryFileNames: '[name].js', + hoistTransitiveImports: false } - return `'${relativePath}'` - } - }, - { - name: 'loader', - resolveId (source) { - return source + ], + external(source) { + return source === 'vscode/l10n' }, - async load (id) { - if (path.dirname(id) === LOC_PATH) { - const packageJson: IExtensionManifest = JSON.parse((await fsPromise.readFile(path.resolve(id, 'package.json'))).toString()) - const mainLocalization = packageJson.contributes!.localizations![0]! + plugins: [ + { + name: 'resolve-asset-url', + resolveFileUrl(options) { + let relativePath = options.relativePath + if (!relativePath.startsWith('.')) { + relativePath = `./${options.relativePath}` + } + return `'${relativePath}'` + } + }, + { + name: 'loader', + resolveId(source) { + return source + }, + async load(id) { + if (path.dirname(id) === LOC_PATH) { + const packageJson: IExtensionManifest = JSON.parse( + (await fsPromise.readFile(path.resolve(id, 'package.json'))).toString() + ) + const mainLocalization = packageJson.contributes!.localizations![0]! - const mainTranslation = mainLocalization.translations.find(t => t.id === 'vscode')! - const otherTranslations = mainLocalization.translations.filter(t => t.id !== 'vscode') + const mainTranslation = mainLocalization.translations.find( + (t) => t.id === 'vscode' + )! + const otherTranslations = mainLocalization.translations.filter( + (t) => t.id !== 'vscode' + ) - const translationAssets: Record = Object.fromEntries(await Promise.all(otherTranslations.map(async t => { - const assetRef = this.emitFile({ - type: 'asset', - name: path.relative('.', t.path), - source: await fsPromise.readFile(path.resolve(id, t.path)) - }) - return [t.id, assetRef] - }))) + const translationAssets: Record = Object.fromEntries( + await Promise.all( + otherTranslations.map(async (t) => { + const assetRef = this.emitFile({ + type: 'asset', + name: path.relative('.', t.path), + source: await fsPromise.readFile(path.resolve(id, t.path)) + }) + return [t.id, assetRef] + }) + ) + ) - return ` + return ` import { registerLocalization } from 'vscode/l10n' import content from '${path.resolve(id, mainTranslation.path)}' registerLocalization('${packageJson.publisher}.${packageJson.name}', '${mainLocalization.languageId}', content, { -${Object.entries(translationAssets).map(([id, assetRef]) => ` '${id}': new URL(import.meta.ROLLUP_FILE_URL_${assetRef}, import.meta.url).href`).join(',\n')} +${Object.entries(translationAssets) + .map( + ([id, assetRef]) => + ` '${id}': new URL(import.meta.ROLLUP_FILE_URL_${assetRef}, import.meta.url).href` + ) + .join(',\n')} }) ` - } - return undefined - }, - transform (code, id) { - if (!id.endsWith('.json')) return null + } + return undefined + }, + transform(code, id) { + if (!id.endsWith('.json')) return null - const parsed: Record> = JSON.parse(code).contents + const parsed: Record> = JSON.parse(code).contents - const encoded = nlsKeys.flatMap(([moduleId, keys]) => { - const moduleValues = parsed[moduleId] - return keys.map(key => moduleValues?.[key]) - }) + const encoded = nlsKeys.flatMap(([moduleId, keys]) => { + const moduleValues = parsed[moduleId] + return keys.map((key) => moduleValues?.[key]) + }) - return { - code: dataToEsm(encoded, { - preferConst: true - }), - map: { mappings: '' } - } - }, - generateBundle () { - const packageJson: PackageJson = { - name: `@codingame/monaco-${name.toLowerCase()}`, - ...Object.fromEntries(Object.entries(pkg).filter(([key]) => ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key))), - private: false, - description: `Language pack designed to be used with ${pkg.name}`, - main: 'index.js', - module: 'index.js', - types: 'index.d.ts', - dependencies: { - vscode: `npm:${pkg.name}@^${pkg.version}` - } - } - this.emitFile({ - fileName: 'package.json', - needsCodeReference: false, - source: JSON.stringify(packageJson, null, 2), - type: 'asset' - }) + return { + code: dataToEsm(encoded, { + preferConst: true + }), + map: { mappings: '' } + } + }, + generateBundle() { + const packageJson: PackageJson = { + name: `@codingame/monaco-${name.toLowerCase()}`, + ...Object.fromEntries( + Object.entries(pkg).filter(([key]) => + ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key) + ) + ), + private: false, + description: `Language pack designed to be used with ${pkg.name}`, + main: 'index.js', + module: 'index.js', + types: 'index.d.ts', + dependencies: { + vscode: `npm:${pkg.name}@^${pkg.version}` + } + } + this.emitFile({ + fileName: 'package.json', + needsCodeReference: false, + source: JSON.stringify(packageJson, null, 2), + type: 'asset' + }) - this.emitFile({ - fileName: 'index.d.ts', - needsCodeReference: false, - source: 'export {}', - type: 'asset' + this.emitFile({ + fileName: 'index.d.ts', + needsCodeReference: false, + source: 'export {}', + type: 'asset' + }) + } + }, + nodeResolve({ + extensions: EXTENSIONS }) - } - }, - nodeResolve({ - extensions: EXTENSIONS - }) - ] - })) + ] + } + ) ]) diff --git a/rollup/rollup.monaco.ts b/rollup/rollup.monaco.ts index d6506a23..d466df5f 100644 --- a/rollup/rollup.monaco.ts +++ b/rollup/rollup.monaco.ts @@ -16,87 +16,100 @@ const MONACO_EDITOR_DIR = path.resolve(BASE_DIR, 'monaco-editor') const BASIC_LANGUAGE_DIR = path.resolve(MONACO_EDITOR_DIR, 'basic-languages') const LANGUAGE_FEATURE_DIR = path.resolve(MONACO_EDITOR_DIR, 'language') -const monacoContributions = (await glob('**/monaco.contribution.js', { - cwd: LANGUAGE_FEATURE_DIR, - onlyFiles: true -})).map(fileName => path.resolve(LANGUAGE_FEATURE_DIR, fileName)) +const monacoContributions = ( + await glob('**/monaco.contribution.js', { + cwd: LANGUAGE_FEATURE_DIR, + onlyFiles: true + }) +).map((fileName) => path.resolve(LANGUAGE_FEATURE_DIR, fileName)) export default rollup.defineConfig([ - ...await Promise.all(monacoContributions.map(async contributionFile => { - const dirname = path.dirname(contributionFile) - const language = path.basename(dirname) - return ({ - input: { - index: contributionFile, - worker: path.resolve(dirname, (await glob('*.worker.js', { - cwd: path.dirname(contributionFile) - }))[0]!) - }, - output: { - minifyInternalExports: false, - preserveModules: true, - assetFileNames: '[name][extname]', - format: 'esm', - dir: `dist/standalone-language-feature-${language}`, - entryFileNames: '[name].js', - hoistTransitiveImports: false - }, - plugins: [ - replace({ - AMD: false, - preventAssignment: true - }), - { - name: 'loader', - resolveId (source) { - if (source.endsWith('editor/editor.api.js')) { - return { - id: 'monaco-editor', - external: true + ...(await Promise.all( + monacoContributions.map(async (contributionFile) => { + const dirname = path.dirname(contributionFile) + const language = path.basename(dirname) + return { + input: { + index: contributionFile, + worker: path.resolve( + dirname, + ( + await glob('*.worker.js', { + cwd: path.dirname(contributionFile) + }) + )[0]! + ) + }, + output: { + minifyInternalExports: false, + preserveModules: true, + assetFileNames: '[name][extname]', + format: 'esm', + dir: `dist/standalone-language-feature-${language}`, + entryFileNames: '[name].js', + hoistTransitiveImports: false + }, + plugins: [ + replace({ + AMD: false, + preventAssignment: true + }), + { + name: 'loader', + resolveId(source) { + if (source.endsWith('editor/editor.api.js')) { + return { + id: 'monaco-editor', + external: true + } } - } - if (source.endsWith('editor/editor.worker.js')) { - return { - id: 'monaco-editor/esm/vs/editor/editor.worker.js', - external: true + if (source.endsWith('editor/editor.worker.js')) { + return { + id: 'monaco-editor/esm/vs/editor/editor.worker.js', + external: true + } } - } - return undefined - }, - generateBundle () { - const packageJson: PackageJson = { - name: `@codingame/monaco-vscode-standalone-${language}-language-features`, - ...Object.fromEntries(Object.entries(pkg).filter(([key]) => ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key))), - private: false, - description: `monaco-editor ${language} language features bundled to work with ${pkg.name}`, - exports: { - '.': { - default: './index.js' + return undefined + }, + generateBundle() { + const packageJson: PackageJson = { + name: `@codingame/monaco-vscode-standalone-${language}-language-features`, + ...Object.fromEntries( + Object.entries(pkg).filter(([key]) => + ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key) + ) + ), + private: false, + description: `monaco-editor ${language} language features bundled to work with ${pkg.name}`, + exports: { + '.': { + default: './index.js' + }, + './worker': { + default: './worker.js' + } }, - './worker': { - default: './worker.js' + main: 'index.js', + module: 'index.js', + dependencies: { + 'monaco-editor': `npm:@codingame/monaco-vscode-editor-api@^${pkg.version}` } - }, - main: 'index.js', - module: 'index.js', - dependencies: { - 'monaco-editor': `npm:@codingame/monaco-vscode-editor-api@^${pkg.version}` } + this.emitFile({ + fileName: 'package.json', + needsCodeReference: false, + source: JSON.stringify(packageJson, null, 2), + type: 'asset' + }) } - this.emitFile({ - fileName: 'package.json', - needsCodeReference: false, - source: JSON.stringify(packageJson, null, 2), - type: 'asset' - }) - } - }, - nodeResolve({ - extensions: EXTENSIONS - }) - ] + }, + nodeResolve({ + extensions: EXTENSIONS + }) + ] + } }) - })), + )), { input: { index: path.resolve(BASIC_LANGUAGE_DIR, 'monaco.contribution.js') @@ -117,7 +130,7 @@ export default rollup.defineConfig([ }), { name: 'loader', - resolveId (source) { + resolveId(source) { if (source.endsWith('editor/editor.api.js')) { return { id: 'monaco-editor', @@ -126,10 +139,14 @@ export default rollup.defineConfig([ } return undefined }, - generateBundle () { + generateBundle() { const packageJson: PackageJson = { name: '@codingame/monaco-vscode-standalone-languages', - ...Object.fromEntries(Object.entries(pkg).filter(([key]) => ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key))), + ...Object.fromEntries( + Object.entries(pkg).filter(([key]) => + ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key) + ) + ), private: false, description: `monaco-editor default language bundled to work with ${pkg.name}`, main: 'index.js', @@ -151,4 +168,5 @@ export default rollup.defineConfig([ extensions: EXTENSIONS }) ] - }]) + } +]) diff --git a/rollup/rollup.rollup-plugins.config.ts b/rollup/rollup.rollup-plugins.config.ts index ba2f512f..5b7d6e44 100644 --- a/rollup/rollup.rollup-plugins.config.ts +++ b/rollup/rollup.rollup-plugins.config.ts @@ -14,26 +14,28 @@ const EXTENSIONS = ['', '.ts', '.js'] const BASE_DIR = path.resolve(__dirname, '..') const TSCONFIG = path.resolve(BASE_DIR, 'tsconfig.rollup.json') -const config: rollup.RollupOptions[] = [{ - input: 'src/rollup-vsix-plugin.ts', - output: 'dist/rollup-vsix-plugin', - description: `Rollup plugin used to load VSCode extension files (VSIX), designed to be used with ${pkg.name}` -}, { - input: 'src/rollup-extension-directory-plugin.ts', - output: 'dist/rollup-extension-directory-plugin', - description: `Rollup plugin used to load VSCode extension already extracted inside a directory, designed to be used with ${pkg.name}` -}].map(({ input, output, description }) => ({ +const config: rollup.RollupOptions[] = [ + { + input: 'src/rollup-vsix-plugin.ts', + output: 'dist/rollup-vsix-plugin', + description: `Rollup plugin used to load VSCode extension files (VSIX), designed to be used with ${pkg.name}` + }, + { + input: 'src/rollup-extension-directory-plugin.ts', + output: 'dist/rollup-extension-directory-plugin', + description: `Rollup plugin used to load VSCode extension already extracted inside a directory, designed to be used with ${pkg.name}` + } +].map(({ input, output, description }) => ({ cache: false, - external: [ - ...Object.keys({ ...pkg.dependencies }), - '@rollup/pluginutils' + external: [...Object.keys({ ...pkg.dependencies }), '@rollup/pluginutils'], + output: [ + { + format: 'esm', + dir: output, + entryFileNames: '[name].js', + chunkFileNames: '[name].js' + } ], - output: [{ - format: 'esm', - dir: output, - entryFileNames: '[name].js', - chunkFileNames: '[name].js' - }], input, plugins: [ commonjs(), @@ -56,17 +58,23 @@ const config: rollup.RollupOptions[] = [{ preferConst: false }), metadataPlugin({ - handle ({ directDependencies }) { + handle({ directDependencies }) { const packageJson: PackageJson = { name: `@codingame/monaco-vscode-${path.basename(output)}`, - ...Object.fromEntries(Object.entries(pkg).filter(([key]) => ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key))), + ...Object.fromEntries( + Object.entries(pkg).filter(([key]) => + ['version', 'keywords', 'author', 'license', 'repository', 'type'].includes(key) + ) + ), private: false, description, main: `${path.basename(output)}.js`, module: `${path.basename(output)}.js`, types: `${path.basename(output)}.d.ts`, dependencies: { - ...Object.fromEntries(Object.entries(pkg.dependencies).filter(([key]) => directDependencies.has(key))) + ...Object.fromEntries( + Object.entries(pkg.dependencies).filter(([key]) => directDependencies.has(key)) + ) } } this.emitFile({ diff --git a/rollup/rollup.types.config.ts b/rollup/rollup.types.config.ts index 02b8ca7a..0c5cd0fa 100644 --- a/rollup/rollup.types.config.ts +++ b/rollup/rollup.types.config.ts @@ -30,19 +30,40 @@ const SERVICE_OVERRIDE_DIR = path.join(TYPES_SRC_DIR, 'service-override') const interfaceOverride = new Map() interfaceOverride.set('Event', 'vscode.Event') -interfaceOverride.set('IActionDescriptor', 'import(\'vs/editor/editor.api\').editor.IActionDescriptor') -interfaceOverride.set('ICodeEditor', 'import(\'vs/editor/editor.api\').editor.ICodeEditor') -interfaceOverride.set('IEditor', 'import(\'vs/editor/editor.api\').editor.IEditor') -interfaceOverride.set('URI', 'import(\'vs/editor/editor.api\').Uri') -interfaceOverride.set('ITextModel', 'import(\'vs/editor/editor.api\').editor.ITextModel') -interfaceOverride.set('vs/editor/common/config/editorOptions:IEditorOptions', 'import(\'vs/editor/editor.api\').editor.IEditorOptions') -interfaceOverride.set('IEditorOverrideServices', 'import(\'vs/editor/editor.api\').editor.IEditorOverrideServices') -interfaceOverride.set('IStandaloneCodeEditor', 'import(\'vs/editor/editor.api\').editor.IStandaloneCodeEditor') -interfaceOverride.set('IStandaloneDiffEditor', 'import(\'vs/editor/editor.api\').editor.IStandaloneDiffEditor') -interfaceOverride.set('IStandaloneEditorConstructionOptions', 'import(\'vs/editor/editor.api\').editor.IStandaloneEditorConstructionOptions') -interfaceOverride.set('IStandaloneDiffEditorConstructionOptions', 'import(\'vs/editor/editor.api\').editor.IStandaloneDiffEditorConstructionOptions') +interfaceOverride.set( + 'IActionDescriptor', + "import('vs/editor/editor.api').editor.IActionDescriptor" +) +interfaceOverride.set('ICodeEditor', "import('vs/editor/editor.api').editor.ICodeEditor") +interfaceOverride.set('IEditor', "import('vs/editor/editor.api').editor.IEditor") +interfaceOverride.set('URI', "import('vs/editor/editor.api').Uri") +interfaceOverride.set('ITextModel', "import('vs/editor/editor.api').editor.ITextModel") +interfaceOverride.set( + 'vs/editor/common/config/editorOptions:IEditorOptions', + "import('vs/editor/editor.api').editor.IEditorOptions" +) +interfaceOverride.set( + 'IEditorOverrideServices', + "import('vs/editor/editor.api').editor.IEditorOverrideServices" +) +interfaceOverride.set( + 'IStandaloneCodeEditor', + "import('vs/editor/editor.api').editor.IStandaloneCodeEditor" +) +interfaceOverride.set( + 'IStandaloneDiffEditor', + "import('vs/editor/editor.api').editor.IStandaloneDiffEditor" +) +interfaceOverride.set( + 'IStandaloneEditorConstructionOptions', + "import('vs/editor/editor.api').editor.IStandaloneEditorConstructionOptions" +) +interfaceOverride.set( + 'IStandaloneDiffEditorConstructionOptions', + "import('vs/editor/editor.api').editor.IStandaloneDiffEditorConstructionOptions" +) -function isExternal (id: string) { +function isExternal(id: string) { if (id.endsWith('.css')) { return true } @@ -51,272 +72,367 @@ function isExternal (id: string) { } return [ - 'vscode', 'tas-client-umd', 'vscode-textmate', 'rollup', '@rollup/pluginutils', '@xterm' - ].some(external => id === external || id.startsWith(`${external}/`)) + 'vscode', + 'tas-client-umd', + 'vscode-textmate', + 'rollup', + '@rollup/pluginutils', + '@xterm' + ].some((external) => id === external || id.startsWith(`${external}/`)) } const proposedApiTypes = await fastGlob('vscode.proposed.*.d.ts', { cwd: VSCODE_SRC_DTS_DIR }) -export default rollup.defineConfig((<{input: Record, output: string, preserveModulesRoot?: string, main?: boolean}[]>[{ - input: { - 'services.d': './dist/types/src/services.d.ts', - 'extensions.d': './dist/types/src/extensions.d.ts', - 'monaco.d': './dist/types/src/monaco.d.ts', - 'l10n.d': './dist/types/src/l10n.d.ts', - 'editor.api.d': './dist/types/src/editor.api.d.ts', - ...Object.fromEntries(fs.readdirSync(path.resolve(DIST_DIR, 'types/src/service-override'), { withFileTypes: true }) - .filter(f => f.isFile()) - .map(f => f.name) - .map(name => [ - `service-override/${path.basename(name, '.ts')}`, `./dist/types/src/service-override/${name}` - ])) - }, - output: 'dist/main', - main: true -}, { - input: { - 'rollup-vsix-plugin.d': './dist/types/src/rollup-vsix-plugin.d.ts' - }, - output: 'dist/rollup-vsix-plugin' -}, { - input: { - 'rollup-extension-directory-plugin.d': './dist/types/src/rollup-extension-directory-plugin.d.ts' - }, - output: 'dist/rollup-extension-directory-plugin' -}]).map(({ input, output, preserveModulesRoot = TYPES_SRC_DIR }) => ({ - input, - treeshake: false, - output: { - preserveModules: true, - preserveModulesRoot, - format: 'esm', - dir: output, - entryFileNames: (chunkInfo) => { - // Rename node_modules to external so it's not removing while publishing the package - // tslib and rollup-plugin-styles and bundled - if (chunkInfo.name.includes('node_modules')) { - return chunkInfo.name.replace('node_modules', 'external') + '.ts' - } - return '[name].ts' +export default rollup.defineConfig( + (< + { + input: Record + output: string + preserveModulesRoot?: string + main?: boolean + }[] + >[ + { + input: { + 'services.d': './dist/types/src/services.d.ts', + 'extensions.d': './dist/types/src/extensions.d.ts', + 'monaco.d': './dist/types/src/monaco.d.ts', + 'l10n.d': './dist/types/src/l10n.d.ts', + 'editor.api.d': './dist/types/src/editor.api.d.ts', + ...Object.fromEntries( + fs + .readdirSync(path.resolve(DIST_DIR, 'types/src/service-override'), { + withFileTypes: true + }) + .filter((f) => f.isFile()) + .map((f) => f.name) + .map((name) => [ + `service-override/${path.basename(name, '.ts')}`, + `./dist/types/src/service-override/${name}` + ]) + ) + }, + output: 'dist/main', + main: true + }, + { + input: { + 'rollup-vsix-plugin.d': './dist/types/src/rollup-vsix-plugin.d.ts' + }, + output: 'dist/rollup-vsix-plugin' + }, + { + input: { + 'rollup-extension-directory-plugin.d': + './dist/types/src/rollup-extension-directory-plugin.d.ts' + }, + output: 'dist/rollup-extension-directory-plugin' } - }, - external: (id) => isExternal(id), - plugins: [ - metadataPlugin({ - stage: 'writeBundle', // rollup-plugin-dts needs the file to exist on the disk - getGroup (id: string) { - if (id.startsWith(SERVICE_OVERRIDE_DIR)) { - const name = path.basename(id, '.d.ts') - return { - name: `service-override/${name}`, - publicName: `@codingame/monaco-vscode-${name}-service-override` - } - } - if (id === path.resolve(TYPES_SRC_DIR, 'editor.api.d.ts')) { - return { - name: 'editor.api', - publicName: '@codingame/monaco-vscode-editor-api' + ]).map( + ({ input, output, preserveModulesRoot = TYPES_SRC_DIR }) => + { + input, + treeshake: false, + output: { + preserveModules: true, + preserveModulesRoot, + format: 'esm', + dir: output, + entryFileNames: (chunkInfo) => { + // Rename node_modules to external so it's not removing while publishing the package + // tslib and rollup-plugin-styles and bundled + if (chunkInfo.name.includes('node_modules')) { + return chunkInfo.name.replace('node_modules', 'external') + '.ts' + } + return '[name].ts' } - } - return { - name: 'main', - publicName: 'vscode', - priority: 1 - } - }, - async handle ({ name: groupName, exclusiveModules, entrypoints }, moduleGroupName, otherDependencies, options, bundle) { - if (groupName === 'main') { - return - } + }, + external: (id) => isExternal(id), + plugins: [ + metadataPlugin({ + stage: 'writeBundle', // rollup-plugin-dts needs the file to exist on the disk + getGroup(id: string) { + if (id.startsWith(SERVICE_OVERRIDE_DIR)) { + const name = path.basename(id, '.d.ts') + return { + name: `service-override/${name}`, + publicName: `@codingame/monaco-vscode-${name}-service-override` + } + } + if (id === path.resolve(TYPES_SRC_DIR, 'editor.api.d.ts')) { + return { + name: 'editor.api', + publicName: '@codingame/monaco-vscode-editor-api' + } + } + return { + name: 'main', + publicName: 'vscode', + priority: 1 + } + }, + async handle( + { name: groupName, exclusiveModules, entrypoints }, + moduleGroupName, + otherDependencies, + options, + bundle + ) { + if (groupName === 'main') { + return + } - const serviceOverrideEntryPoint = Array.from(entrypoints)[0]! - const entrypointInfo = this.getModuleInfo(serviceOverrideEntryPoint)! + const serviceOverrideEntryPoint = Array.from(entrypoints)[0]! + const entrypointInfo = this.getModuleInfo(serviceOverrideEntryPoint)! - const groupBundle = await rollup.rollup({ - input: { - [groupName === 'editor.api' ? 'esm/vs/editor/editor.api.d' : 'index.d']: 'entrypoint' - }, - external: (id) => { - if (id === 'vscode') { - // we need to load the proposed types of vscode, so let says it's not external and override the load method to load the proposed types - return undefined - } - return isExternal(id) - }, - plugins: [ - { - name: 'loader', - resolveId (source, importer) { - if (source === 'entrypoint') { - return source - } - if (source === 'vscode') { - return { - id: 'vscode', - external: true + const groupBundle = await rollup.rollup({ + input: { + [groupName === 'editor.api' ? 'esm/vs/editor/editor.api.d' : 'index.d']: + 'entrypoint' + }, + external: (id) => { + if (id === 'vscode') { + // we need to load the proposed types of vscode, so let says it's not external and override the load method to load the proposed types + return undefined } - } - const importerDir = path.dirname(path.resolve(DIST_DIR_MAIN, importer ?? '/')) - const resolved = path.resolve(importerDir, source) - const resolvedWithoutExtension = resolved.endsWith('.js') ? resolved.slice(0, -3) : resolved - const resolvedWithExtension = resolvedWithoutExtension.endsWith('.d.ts') ? resolvedWithoutExtension : `${resolvedWithoutExtension}.d.ts` + return isExternal(id) + }, + plugins: [ + { + name: 'loader', + resolveId(source, importer) { + if (source === 'entrypoint') { + return source + } + if (source === 'vscode') { + return { + id: 'vscode', + external: true + } + } + const importerDir = path.dirname(path.resolve(DIST_DIR_MAIN, importer ?? '/')) + const resolved = path.resolve(importerDir, source) + const resolvedWithoutExtension = resolved.endsWith('.js') + ? resolved.slice(0, -3) + : resolved + const resolvedWithExtension = resolvedWithoutExtension.endsWith('.d.ts') + ? resolvedWithoutExtension + : `${resolvedWithoutExtension}.d.ts` + + const isVscodeFile = resolved.startsWith( + path.resolve(DIST_DIR_MAIN, 'vscode') + ) + const isServiceOverride = + path.dirname(resolved) === path.resolve(DIST_DIR_MAIN, 'service-override') + const isExclusive = exclusiveModules.has(resolvedWithExtension) - const isVscodeFile = resolved.startsWith(path.resolve(DIST_DIR_MAIN, 'vscode')) - const isServiceOverride = path.dirname(resolved) === path.resolve(DIST_DIR_MAIN, 'service-override') - const isExclusive = exclusiveModules.has(resolvedWithExtension) + if ((isVscodeFile || isServiceOverride) && !isExclusive) { + function getPackageFromGroupName(groupName: string) { + if (groupName === 'main') { + return 'vscode' + } + const [_, category, name] = /^(.*):(.*)$/.exec(groupName)! + return `@codingame/monaco-vscode-${name}-${category}` + } + const importFromGroup = isVscodeFile + ? (moduleGroupName.get(resolved) ?? 'main') + : 'main' + const importFromModule = getPackageFromGroupName(importFromGroup) + const externalResolved = resolved.startsWith(DIST_DIR_VSCODE_SRC_MAIN) + ? `${importFromModule}/vscode/${path.relative(DIST_DIR_VSCODE_SRC_MAIN, resolvedWithoutExtension)}` + : `${importFromModule}/${path.relative(DIST_DIR_MAIN, resolvedWithoutExtension)}` + // Those modules will be imported from external monaco-vscode-api + return { + id: externalResolved, + external: true + } + } - if ((isVscodeFile || isServiceOverride) && !isExclusive) { - function getPackageFromGroupName (groupName: string) { - if (groupName === 'main') { - return 'vscode' + return undefined + }, + load(id) { + if (id === 'entrypoint') { + const entryTypesPath = `${path.resolve(DIST_DIR_MAIN, groupName)}` + const codeLines: string[] = [] + if ((entrypointInfo.exports ?? []).includes('default')) { + codeLines.push(`export { default } from '${entryTypesPath}'`) + } + if ((entrypointInfo.exports ?? []).some((e) => e !== 'default')) { + codeLines.push(`export * from '${entryTypesPath}'`) + } + return codeLines.join('\n') + } + if (id.startsWith('vscode/')) { + return ( + bundle[path.relative('vscode', id)] as rollup.OutputChunk | undefined + )?.code + } + return ( + bundle[path.relative(DIST_DIR_MAIN, id)] as rollup.OutputChunk | undefined + )?.code } - const [_, category, name] = /^(.*):(.*)$/.exec(groupName)! - return `@codingame/monaco-vscode-${name}-${category}` - } - const importFromGroup = isVscodeFile ? moduleGroupName.get(resolved) ?? 'main' : 'main' - const importFromModule = getPackageFromGroupName(importFromGroup) - const externalResolved = resolved.startsWith(DIST_DIR_VSCODE_SRC_MAIN) ? `${importFromModule}/vscode/${path.relative(DIST_DIR_VSCODE_SRC_MAIN, resolvedWithoutExtension)}` : `${importFromModule}/${path.relative(DIST_DIR_MAIN, resolvedWithoutExtension)}` - // Those modules will be imported from external monaco-vscode-api - return { - id: externalResolved, - external: true - } - } + }, + dts({ + respectExternal: true + }) + ] + }) + await groupBundle.write({ + preserveModules: true, + preserveModulesRoot: path.dirname(path.resolve(DIST_DIR_MAIN, groupName)), + minifyInternalExports: false, + assetFileNames: 'assets/[name][extname]', + format: 'esm', + dir: path.resolve(DIST_DIR, paramCase(groupName.replace(/\//g, '-'))), + entryFileNames: '[name].ts', + hoistTransitiveImports: false + }) + await groupBundle.close() - return undefined - }, - load (id) { - if (id === 'entrypoint') { - const entryTypesPath = `${path.resolve(DIST_DIR_MAIN, groupName)}` - const codeLines: string[] = [] - if ((entrypointInfo.exports ?? []).includes('default')) { - codeLines.push(`export { default } from '${entryTypesPath}'`) - } - if ((entrypointInfo.exports ?? []).some(e => e !== 'default')) { - codeLines.push(`export * from '${entryTypesPath}'`) - } - return codeLines.join('\n') - } - if (id.startsWith('vscode/')) { - return (bundle[path.relative('vscode', id)] as rollup.OutputChunk | undefined)?.code - } - return (bundle[path.relative(DIST_DIR_MAIN, id)] as rollup.OutputChunk | undefined)?.code - } + // remove exclusive files from main bundle to prevent them from being duplicated + await Promise.all( + Array.from(exclusiveModules) + .filter((m) => m.startsWith(DIST_DIR_MAIN)) + .map(async (module) => { + await fsPromise.rm(module) + }) + ) + } + }), + { + name: 'change-unsupported-syntax', + transform(code) { + return code.replace( + 'export import Severity = BaseSeverity;', + 'type Severity = BaseSeverity; export { Severity }' + ) + } + }, + { + name: 'resolve-vscode-proposed-types', + transform(code) { + return code.replace('/** PROPOSED-type-references */', () => + proposedApiTypes + .map((file) => `/// `) + .join('\n') + ) }, - dts({ - respectExternal: true - }) - ] - }) - await groupBundle.write({ - preserveModules: true, - preserveModulesRoot: path.dirname(path.resolve(DIST_DIR_MAIN, groupName)), - minifyInternalExports: false, - assetFileNames: 'assets/[name][extname]', - format: 'esm', - dir: path.resolve(DIST_DIR, paramCase(groupName.replace(/\//g, '-'))), - entryFileNames: '[name].ts', - hoistTransitiveImports: false - }) - await groupBundle.close() - - // remove exclusive files from main bundle to prevent them from being duplicated - await Promise.all(Array.from(exclusiveModules).filter(m => m.startsWith(DIST_DIR_MAIN)).map(async module => { - await fsPromise.rm(module) - })) - } - }), - { - name: 'change-unsupported-syntax', - transform (code) { - return code.replace('export import Severity = BaseSeverity;', 'type Severity = BaseSeverity; export { Severity }') - } - }, - { - name: 'resolve-vscode-proposed-types', - transform (code) { - return code.replace('/** PROPOSED-type-references */', () => proposedApiTypes.map(file => `/// `).join('\n')) - }, - async generateBundle () { - await Promise.all(proposedApiTypes.map(async file => this.emitFile({ - type: 'asset', - needsCodeReference: false, - fileName: `vscode-dts/${file}`, - source: await fsPromise.readFile(path.resolve(VSCODE_SRC_DTS_DIR, file)) - }))) - } - }, - { - name: 'replace-interfaces', - load (id) { - const sourceFile = project.addSourceFileAtPath(id) + async generateBundle() { + await Promise.all( + proposedApiTypes.map(async (file) => + this.emitFile({ + type: 'asset', + needsCodeReference: false, + fileName: `vscode-dts/${file}`, + source: await fsPromise.readFile(path.resolve(VSCODE_SRC_DTS_DIR, file)) + }) + ) + ) + } + }, + { + name: 'replace-interfaces', + load(id) { + const sourceFile = project.addSourceFileAtPath(id) - if (id.includes('node_modules') && id.includes('xterm')) { - // xterm modules use `declare module` syntax not supposed by the rollup-dts-plugin, so let's transform the code - const module = sourceFile.getModules()[0]! - for (const _interface of module.getInterfaces()) { - _interface.setIsExported(true) - } - return `${sourceFile.getImportDeclarations().map(e => e.getText()).join('\n')}\n${module.getBodyText()}` - } + if (id.includes('node_modules') && id.includes('xterm')) { + // xterm modules use `declare module` syntax not supposed by the rollup-dts-plugin, so let's transform the code + const module = sourceFile.getModules()[0]! + for (const _interface of module.getInterfaces()) { + _interface.setIsExported(true) + } + return `${sourceFile + .getImportDeclarations() + .map((e) => e.getText()) + .join('\n')}\n${module.getBodyText()}` + } - if (sourceFile.getImportDeclaration('vscode') == null) { - sourceFile.addImportDeclaration({ - moduleSpecifier: 'vscode', - namespaceImport: 'vscode' - }) - } + if (sourceFile.getImportDeclaration('vscode') == null) { + sourceFile.addImportDeclaration({ + moduleSpecifier: 'vscode', + namespaceImport: 'vscode' + }) + } - return sourceFile.getFullText() - }, - transform (code, id) { - if (!id.endsWith('editor.api.d.ts')) { - interfaceOverride.forEach((value, key) => { - const [, path, name] = /(?:(.*):)?(.*)/.exec(key)! - if (path == null || path === id) { - code = code.replace(`interface ${name} `, `type ${name} = ${value}\ninterface _${name} `) + return sourceFile.getFullText() + }, + transform(code, id) { + if (!id.endsWith('editor.api.d.ts')) { + interfaceOverride.forEach((value, key) => { + const [, path, name] = /(?:(.*):)?(.*)/.exec(key)! + if (path == null || path === id) { + code = code.replace( + `interface ${name} `, + `type ${name} = ${value}\ninterface _${name} ` + ) + } + }) + } else { + code = code.replace( + "declare module 'vs/editor/editor.api'", + "declare module 'vscode/vscode/vs/editor/editor.api'" + ) + } + return code + }, + renderChunk(code, chunk) { + const chunkParentPath = path.resolve(DIST_DIR, path.dirname(chunk.fileName)) + if (code.includes('DebugProtocol')) { + const importPath = path.relative( + chunkParentPath, + path.resolve(DIST_DIR, 'debugProtocol.d.ts') + ) + return `/// \n\n${code}` + } + return undefined + }, + async generateBundle(options, bundle) { + const editorTypesChunk = bundle['vscode/src/vs/editor/editor.api.d.ts'] as + | rollup.OutputChunk + | undefined + if (editorTypesChunk != null) { + editorTypesChunk.code = ( + await fs.promises.readFile( + path.resolve(PROJECT_ROOT, 'monaco-editor/editor.api.d.ts') + ) + ).toString('utf-8') + } + } + }, + { + name: 'resolve-vscode', + resolveId: async function (importee, importer) { + const importeeWithoutExtension = importee.endsWith('.js') + ? importee.slice(0, -3) + : importee + if (importeeWithoutExtension.startsWith('vscode/')) { + return path.resolve( + VSCODE_DIR, + path.relative('vscode', `${importeeWithoutExtension}.d.ts`) + ) + } + if ( + importeeWithoutExtension.startsWith('.') && + importer != null && + importeeWithoutExtension.startsWith(VSCODE_SRC_DIR) + ) { + importee = path.relative( + VSCODE_SRC_DIR, + path.resolve(path.dirname(importer), importeeWithoutExtension) + ) + } + if (importeeWithoutExtension.startsWith('vs/')) { + return path.join(VSCODE_SRC_DIR, `${importeeWithoutExtension}.d.ts`) + } + return undefined } + }, + dts({ + respectExternal: true }) - } else { - code = code.replace("declare module 'vs/editor/editor.api'", "declare module 'vscode/vscode/vs/editor/editor.api'") - } - return code - }, - renderChunk (code, chunk) { - const chunkParentPath = path.resolve(DIST_DIR, path.dirname(chunk.fileName)) - if (code.includes('DebugProtocol')) { - const importPath = path.relative(chunkParentPath, path.resolve(DIST_DIR, 'debugProtocol.d.ts')) - return `/// \n\n${code}` - } - return undefined - }, - async generateBundle (options, bundle) { - const editorTypesChunk = bundle['vscode/src/vs/editor/editor.api.d.ts'] as rollup.OutputChunk | undefined - if (editorTypesChunk != null) { - editorTypesChunk.code = (await fs.promises.readFile(path.resolve(PROJECT_ROOT, 'monaco-editor/editor.api.d.ts'))).toString('utf-8') - } + ] } - }, - { - name: 'resolve-vscode', - resolveId: async function (importee, importer) { - const importeeWithoutExtension = importee.endsWith('.js') ? importee.slice(0, -3) : importee - if (importeeWithoutExtension.startsWith('vscode/')) { - return path.resolve(VSCODE_DIR, path.relative('vscode', `${importeeWithoutExtension}.d.ts`)) - } - if (importeeWithoutExtension.startsWith('.') && importer != null && importeeWithoutExtension.startsWith(VSCODE_SRC_DIR)) { - importee = path.relative(VSCODE_SRC_DIR, path.resolve(path.dirname(importer), importeeWithoutExtension)) - } - if (importeeWithoutExtension.startsWith('vs/')) { - return path.join(VSCODE_SRC_DIR, `${importeeWithoutExtension}.d.ts`) - } - return undefined - } - }, - dts({ - respectExternal: true - }) - ] -}))) + ) +) diff --git a/src/assets.ts b/src/assets.ts index 333e1b96..52b07c5e 100644 --- a/src/assets.ts +++ b/src/assets.ts @@ -1,6 +1,6 @@ import { FileAccess } from 'vs/base/common/network' -export function registerAssets (assets: Record string)>): void { +export function registerAssets(assets: Record string)>): void { for (const [moduleId, url] of Object.entries(assets)) { FileAccess.registerAppResourcePathUrl(moduleId, url) } diff --git a/src/editor.api.ts b/src/editor.api.ts index 82ae542b..0b34b69a 100644 --- a/src/editor.api.ts +++ b/src/editor.api.ts @@ -1,21 +1,25 @@ import { editor, languages } from 'vs/editor/editor.api' -import { createConfiguredEditor, createConfiguredDiffEditor, createModelReference, writeFile } from './monaco' +import { + createConfiguredEditor, + createConfiguredDiffEditor, + createModelReference, + writeFile +} from './monaco' import { withReadyServices } from './services' export * from 'vs/editor/editor.api' declare module 'vs/editor/editor.api' { export namespace editor { - export { - createModelReference, - writeFile - } + export { createModelReference, writeFile } } } const originalOnLanguage = languages.onLanguage -languages.onLanguage = (languageId: string, callback: () => void) => withReadyServices(() => originalOnLanguage(languageId, callback)) +languages.onLanguage = (languageId: string, callback: () => void) => + withReadyServices(() => originalOnLanguage(languageId, callback)) const originalOnLanguageEncountered = languages.onLanguage -languages.onLanguageEncountered = (languageId: string, callback: () => void) => withReadyServices(() => originalOnLanguageEncountered(languageId, callback)) +languages.onLanguageEncountered = (languageId: string, callback: () => void) => + withReadyServices(() => originalOnLanguageEncountered(languageId, callback)) editor.create = createConfiguredEditor as unknown as typeof editor.create editor.createDiffEditor = createConfiguredDiffEditor as unknown as typeof editor.createDiffEditor editor.createModelReference = createModelReference diff --git a/src/extension-tools.ts b/src/extension-tools.ts index 33c3cd51..3213f026 100644 --- a/src/extension-tools.ts +++ b/src/extension-tools.ts @@ -1,4 +1,14 @@ -import type { IColorTheme, ICommand, IExtensionContributions, IExtensionManifest, IGrammar, IIconTheme, IJSONValidation, ILanguage, ISnippet } from 'vs/platform/extensions/common/extensions' +import type { + IColorTheme, + ICommand, + IExtensionContributions, + IExtensionManifest, + IGrammar, + IIconTheme, + IJSONValidation, + ILanguage, + ISnippet +} from 'vs/platform/extensions/common/extensions' import { ParseError, parse } from 'vs/base/common/json.js' import { getParseErrorMessage } from 'vs/base/common/jsonErrorMessages' import { IUserFriendlyViewsContainerDescriptor } from 'vs/workbench/api/browser/viewsExtensionPoint' @@ -16,12 +26,10 @@ export interface ExtensionResource { size: number } -const plainTextExtensions = [ - '.d.ts' -] +const plainTextExtensions = ['.d.ts'] -function lookupMime (path: string) { - if (plainTextExtensions.some(e => path.endsWith(e))) { +function lookupMime(path: string) { + if (plainTextExtensions.some((e) => path.endsWith(e))) { return 'text/plain' } const mimeType = mime.lookup(path) @@ -31,7 +39,7 @@ function lookupMime (path: string) { return mimeType } -function getPaths (filePath: string) { +function getPaths(filePath: string) { const paths = [filePath] if (path.extname(filePath) === '.js') { paths.push(filePath.substring(0, filePath.lastIndexOf('.'))) @@ -39,7 +47,11 @@ function getPaths (filePath: string) { return paths } -export function toResource (resourcePath: string, fs: typeof nodeFs, cwd: string): ExtensionResource { +export function toResource( + resourcePath: string, + fs: typeof nodeFs, + cwd: string +): ExtensionResource { return { path: resourcePath, extensionPaths: getPaths(resourcePath), @@ -48,7 +60,7 @@ export function toResource (resourcePath: string, fs: typeof nodeFs, cwd: string } } -function extractCommandResources (command: ICommand | ICommand[]): string[] { +function extractCommandResources(command: ICommand | ICommand[]): string[] { if (Array.isArray(command)) { return command.flatMap(extractCommandResources) } @@ -62,11 +74,11 @@ function extractCommandResources (command: ICommand | ICommand[]): string[] { return [] } -function extractGrammarResources (grammar: IGrammar): string[] { +function extractGrammarResources(grammar: IGrammar): string[] { return [grammar.path] } -function extractLanguageResources (language: ILanguage): string[] { +function extractLanguageResources(language: ILanguage): string[] { const resources: string[] = [] if (language.icon != null) { resources.push(language.icon.dark!, language.icon.light!) @@ -77,7 +89,7 @@ function extractLanguageResources (language: ILanguage): string[] { return resources } -function extractSnippetsResources (snippet: ISnippet): string[] { +function extractSnippetsResources(snippet: ISnippet): string[] { return [snippet.path] } @@ -86,7 +98,7 @@ interface IconDefinition { } interface FontDefinition { - src: { path: string, format: string }[] + src: { path: string; format: string }[] } interface IconThemeDocument { @@ -94,7 +106,11 @@ interface IconThemeDocument { fonts?: FontDefinition[] } -async function extractThemeResources (theme: IColorTheme | IIconTheme, fs: typeof nodeFs, cwd: string): Promise { +async function extractThemeResources( + theme: IColorTheme | IIconTheme, + fs: typeof nodeFs, + cwd: string +): Promise { const themeContent = await fs.promises.readFile(path.join(cwd, theme.path)) const themeDocument = parseJson(theme.path, themeContent.toString('utf8')) const paths: string[] = [theme.path] @@ -115,81 +131,146 @@ async function extractThemeResources (theme: IColorTheme | IIconTheme, fs: typeo return paths } -function extractJsonValidationResources (jsonValidation: IJSONValidation): string[] { +function extractJsonValidationResources(jsonValidation: IJSONValidation): string[] { if (jsonValidation.url.startsWith('./')) { return [jsonValidation.url] } return [] } -function extractViewsContainerResources (viewContainers: { [loc: string]: IUserFriendlyViewsContainerDescriptor[] }): string[] { - return Object.values(viewContainers).flatMap(containers => containers.map(container => container.icon)) +function extractViewsContainerResources(viewContainers: { + [loc: string]: IUserFriendlyViewsContainerDescriptor[] +}): string[] { + return Object.values(viewContainers).flatMap((containers) => + containers.map((container) => container.icon) + ) } -async function extractResourcesFromExtensionManifestContribute (contribute: IExtensionContributions & { [customKey: string]: unknown }, fs: typeof nodeFs, cwd: string): Promise { +async function extractResourcesFromExtensionManifestContribute( + contribute: IExtensionContributions & { [customKey: string]: unknown }, + fs: typeof nodeFs, + cwd: string +): Promise { const resources: string[] = [] if (contribute.commands != null) resources.push(...extractCommandResources(contribute.commands)) - if (contribute.grammars != null) resources.push(...contribute.grammars.flatMap(extractGrammarResources)) - if (contribute.languages != null) resources.push(...contribute.languages.flatMap(extractLanguageResources)) - if (contribute.snippets != null) resources.push(...contribute.snippets.flatMap(extractSnippetsResources)) - if (contribute.themes != null) resources.push(...((await Promise.all(contribute.themes.map(theme => extractThemeResources(theme, fs, cwd)))).flat())) - if (contribute.iconThemes != null) resources.push(...((await Promise.all(contribute.iconThemes.map(theme => extractThemeResources(theme, fs, cwd)))).flat())) - if (contribute.productIconThemes != null) resources.push(...((await Promise.all(contribute.productIconThemes.map(theme => extractThemeResources(theme, fs, cwd)))).flat())) - if (contribute.jsonValidation != null) resources.push(...contribute.jsonValidation.flatMap(extractJsonValidationResources)) - if (contribute.viewsContainers != null) resources.push(...extractViewsContainerResources(contribute.viewsContainers)) + if (contribute.grammars != null) + resources.push(...contribute.grammars.flatMap(extractGrammarResources)) + if (contribute.languages != null) + resources.push(...contribute.languages.flatMap(extractLanguageResources)) + if (contribute.snippets != null) + resources.push(...contribute.snippets.flatMap(extractSnippetsResources)) + if (contribute.themes != null) + resources.push( + ...( + await Promise.all(contribute.themes.map((theme) => extractThemeResources(theme, fs, cwd))) + ).flat() + ) + if (contribute.iconThemes != null) + resources.push( + ...( + await Promise.all( + contribute.iconThemes.map((theme) => extractThemeResources(theme, fs, cwd)) + ) + ).flat() + ) + if (contribute.productIconThemes != null) + resources.push( + ...( + await Promise.all( + contribute.productIconThemes.map((theme) => extractThemeResources(theme, fs, cwd)) + ) + ).flat() + ) + if (contribute.jsonValidation != null) + resources.push(...contribute.jsonValidation.flatMap(extractJsonValidationResources)) + if (contribute.viewsContainers != null) + resources.push(...extractViewsContainerResources(contribute.viewsContainers)) if (contribute['markdown.previewStyles'] != null) { - resources.push(...(await Promise.all((contribute['markdown.previewStyles']).map(async path => [ - path, - ...(await extractResources(path, fs, cwd)) - ]))).flat()) + resources.push( + ...( + await Promise.all( + (contribute['markdown.previewStyles']).map(async (path) => [ + path, + ...(await extractResources(path, fs, cwd)) + ]) + ) + ).flat() + ) } if (contribute['markdown.previewScripts'] != null) { - resources.push(...(await Promise.all((contribute['markdown.previewScripts']).map(async path => [ - path, - ...(await extractResources(path, fs, cwd)) - ]))).flat()) + resources.push( + ...( + await Promise.all( + (contribute['markdown.previewScripts']).map(async (path) => [ + path, + ...(await extractResources(path, fs, cwd)) + ]) + ) + ).flat() + ) } - return resources.filter((resource, index, list) => !resource.startsWith('$(') && !list.slice(0, index).some(o => o === resource)) + return resources.filter( + (resource, index, list) => + !resource.startsWith('$(') && !list.slice(0, index).some((o) => o === resource) + ) } -export async function getExtensionResources (manifest: IExtensionManifest, fs: typeof nodeFs, cwd: string): Promise { +export async function getExtensionResources( + manifest: IExtensionManifest, + fs: typeof nodeFs, + cwd: string +): Promise { if (manifest.browser != null || manifest.contributes?.typescriptServerPlugins != null) { // there is some js in the extension, it's impossible to predict which file will be used, bundle everything - return (await glob('**/*', { - fs: fs, - cwd, - onlyFiles: true - })).map(p => toResource(p, fs, cwd)) + return ( + await glob('**/*', { + fs: fs, + cwd, + onlyFiles: true + }) + ).map((p) => toResource(p, fs, cwd)) } else { - return (await extractResourcesFromExtensionManifest(manifest, fs, cwd)).map(p => toResource(p, fs, cwd)) + return (await extractResourcesFromExtensionManifest(manifest, fs, cwd)).map((p) => + toResource(p, fs, cwd) + ) } } -async function extractResourcesFromExtensionManifest (manifest: IExtensionManifest, fs: typeof nodeFs, cwd: string): Promise { +async function extractResourcesFromExtensionManifest( + manifest: IExtensionManifest, + fs: typeof nodeFs, + cwd: string +): Promise { const resources: string[] = [] const children = await fs.promises.readdir('/') - const readme = children.filter(child => /^readme(\.txt|\.md|)$/i.test(child))[0] + const readme = children.filter((child) => /^readme(\.txt|\.md|)$/i.test(child))[0] if (readme != null) resources.push(readme) - const changelog = children.filter(child => /^changelog(\.txt|\.md|)$/i.test(child))[0] + const changelog = children.filter((child) => /^changelog(\.txt|\.md|)$/i.test(child))[0] if (changelog != null) resources.push(changelog) if (manifest.contributes != null) { - resources.push(...await extractResourcesFromExtensionManifestContribute(manifest.contributes, fs, cwd)) + resources.push( + ...(await extractResourcesFromExtensionManifestContribute( + manifest.contributes, + fs, + cwd + )) + ) } - const manifestFiles = (await glob('{package.nls.json,package.nls.*.json,package.json}', { + const manifestFiles = await glob('{package.nls.json,package.nls.*.json,package.json}', { fs: fs, cwd, onlyFiles: true - })) - resources.push(...manifestFiles.map(path => path)) + }) + resources.push(...manifestFiles.map((path) => path)) if (manifest.l10n != null) { - const bundleFiles = (await glob('{bundle.l10n.json,bundle.l10n.*.json}', { + const bundleFiles = await glob('{bundle.l10n.json,bundle.l10n.*.json}', { fs: fs, cwd: path.join(cwd, manifest.l10n), onlyFiles: true - })) + }) resources.push(...bundleFiles) } @@ -201,7 +282,11 @@ async function extractResourcesFromExtensionManifest (manifest: IExtensionManife return Array.from(new Set(resources)) } -async function extractResources (resourcePath: string, fs: typeof nodeFs, cwd: string): Promise { +async function extractResources( + resourcePath: string, + fs: typeof nodeFs, + cwd: string +): Promise { const resources: string[] = [] const content = (await fs.promises.readFile(resourcePath)).toString('utf-8') @@ -222,11 +307,13 @@ async function extractResources (resourcePath: string, fs: typeof nodeFs, cwd: s return resources } -export function parseJson (path: string, text: string): T { +export function parseJson(path: string, text: string): T { const errors: ParseError[] = [] const result = parse(text, errors) if (errors.length > 0) { - throw new Error(`Failed to parse ${path}:\n${errors.map(error => ` ${getParseErrorMessage(error.error)}`).join('\n')}`) + throw new Error( + `Failed to parse ${path}:\n${errors.map((error) => ` ${getParseErrorMessage(error.error)}`).join('\n')}` + ) } return result } diff --git a/src/extension.api.ts b/src/extension.api.ts index 6fe35830..90cdbf1a 100644 --- a/src/extension.api.ts +++ b/src/extension.api.ts @@ -19,20 +19,25 @@ import * as telemetry from 'vs/platform/telemetry/common/telemetryUtils' let defaultApi: typeof vscode | undefined -export function setDefaultApi (api: typeof vscode): void { +export function setDefaultApi(api: typeof vscode): void { defaultApi = api } -function createProxy (key: T): typeof vscode[T] { - return new Proxy({}, { - get (target, p) { - if (defaultApi == null) { - throw new Error('Default api is not ready yet, do not forget to import \'vscode/localExtensionHost\' and wait for services initialization') +function createProxy(key: T): (typeof vscode)[T] { + return new Proxy( + {}, + { + get(target, p) { + if (defaultApi == null) { + throw new Error( + "Default api is not ready yet, do not forget to import 'vscode/localExtensionHost' and wait for services initialization" + ) + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (defaultApi[key] as any)[p] } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return (defaultApi[key] as any)[p] } - }) as typeof vscode[T] + ) as (typeof vscode)[T] } const api: typeof vscode = { @@ -183,7 +188,8 @@ const api: typeof vscode = { TerminalLocation: extHostTypes.TerminalLocation, TerminalProfile: extHostTypes.TerminalProfile, TerminalExitReason: extHostTypes.TerminalExitReason, - TerminalShellExecutionCommandLineConfidence: extHostTypes.TerminalShellExecutionCommandLineConfidence, + TerminalShellExecutionCommandLineConfidence: + extHostTypes.TerminalShellExecutionCommandLineConfidence, TextDocumentSaveReason: extHostTypes.TextDocumentSaveReason, TextEdit: extHostTypes.TextEdit, SnippetTextEdit: extHostTypes.SnippetTextEdit, @@ -291,7 +297,8 @@ const api: typeof vscode = { ChatResponseCodeCitationPart: extHostTypes.ChatResponseCodeCitationPart, ChatResponseWarningPart: extHostTypes.ChatResponseWarningPart, ChatResponseTextEditPart: extHostTypes.ChatResponseTextEditPart, - ChatResponseMarkdownWithVulnerabilitiesPart: extHostTypes.ChatResponseMarkdownWithVulnerabilitiesPart, + ChatResponseMarkdownWithVulnerabilitiesPart: + extHostTypes.ChatResponseMarkdownWithVulnerabilitiesPart, ChatResponseCommandButtonPart: extHostTypes.ChatResponseCommandButtonPart, ChatResponseDetectedParticipantPart: extHostTypes.ChatResponseDetectedParticipantPart, ChatResponseConfirmationPart: extHostTypes.ChatResponseConfirmationPart, diff --git a/src/extensions.ts b/src/extensions.ts index deca9883..54d047b0 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -1,6 +1,12 @@ /** PROPOSED-type-references */ import type * as vscode from 'vscode' -import { ExtensionType, IExtension, IExtensionContributions, IExtensionManifest, TargetPlatform } from 'vs/platform/extensions/common/extensions' +import { + ExtensionType, + IExtension, + IExtensionContributions, + IExtensionManifest, + TargetPlatform +} from 'vs/platform/extensions/common/extensions' import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions.service' import { URI } from 'vs/base/common/uri' import { getExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil' @@ -15,10 +21,18 @@ import { IFileService } from 'vs/platform/files/common/files.service' import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' import { IWorkbenchExtensionEnablementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement.service' import { StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices' -import { ExtensionManifestTranslator, NlsConfiguration } from 'vs/platform/extensionManagement/common/extensionsScannerService' +import { + ExtensionManifestTranslator, + NlsConfiguration +} from 'vs/platform/extensionManagement/common/extensionsScannerService' import * as platform from 'vs/base/common/platform' import { IExtensionWithExtHostKind, ExtensionServiceOverride } from './service-override/extensions' -import { CustomSchemas, ExtensionFileMetadata, RegisteredUriFile, registerExtensionFile } from './service-override/files' +import { + CustomSchemas, + ExtensionFileMetadata, + RegisteredUriFile, + registerExtensionFile +} from './service-override/files' import { waitServicesReady } from './lifecycle' import { throttle } from './tools' import { setDefaultApi } from './extension.api' @@ -27,7 +41,7 @@ import { getBuiltInExtensionTranslationsUris } from './l10n' export type ApiFactory = (extensionId?: string) => Promise let apiFactory: ApiFactory | undefined -export function registerLocalApiFactory (_apiFactory: ApiFactory): void { +export function registerLocalApiFactory(_apiFactory: ApiFactory): void { apiFactory = _apiFactory } @@ -44,29 +58,40 @@ interface RegisterRemoteExtensionParams extends RegisterExtensionParams { interface RegisterExtensionResult { id: string - dispose (): Promise + dispose(): Promise whenReady(): Promise isEnabled(): Promise } -interface RegisterRemoteExtensionResult extends RegisterExtensionResult { -} +interface RegisterRemoteExtensionResult extends RegisterExtensionResult {} interface RegisterLocalExtensionResult extends RegisterExtensionResult { registerFileUrl: (path: string, url: string) => IDisposable } interface RegisterLocalProcessExtensionResult extends RegisterLocalExtensionResult { - getApi (): Promise - setAsDefaultApi (): Promise + getApi(): Promise + setAsDefaultApi(): Promise } -function registerExtensionFileUrl (extensionLocation: URI, filePath: string, url: string, metadataOrMimeType?: string | ExtensionFileMetadata): IDisposable { +function registerExtensionFileUrl( + extensionLocation: URI, + filePath: string, + url: string, + metadataOrMimeType?: string | ExtensionFileMetadata +): IDisposable { const fileDisposable = new DisposableStore() - fileDisposable.add(FileAccess.registerStaticBrowserUri(joinPath(extensionLocation, filePath), URI.parse(url))) + fileDisposable.add( + FileAccess.registerStaticBrowserUri(joinPath(extensionLocation, filePath), URI.parse(url)) + ) - const metadata: ExtensionFileMetadata | undefined = typeof metadataOrMimeType === 'string' ? { mimeType: metadataOrMimeType } : metadataOrMimeType - fileDisposable.add(registerExtensionFile(new RegisteredUriFile(joinPath(extensionLocation, filePath), url, metadata))) + const metadata: ExtensionFileMetadata | undefined = + typeof metadataOrMimeType === 'string' ? { mimeType: metadataOrMimeType } : metadataOrMimeType + fileDisposable.add( + registerExtensionFile( + new RegisteredUriFile(joinPath(extensionLocation, filePath), url, metadata) + ) + ) return fileDisposable } @@ -74,17 +99,28 @@ interface ExtensionDelta { toAdd: IExtensionWithExtHostKind[] toRemove: IExtension[] } -const deltaExtensions = throttle(async ({ toAdd, toRemove }: ExtensionDelta) => { - await waitServicesReady() - const extensionService = StandaloneServices.get(IExtensionService) as ExtensionServiceOverride - await extensionService.deltaExtensions(toAdd, toRemove) -}, (a, b) => ({ toAdd: [...a.toAdd, ...b.toAdd], toRemove: [...a.toRemove, ...b.toRemove] }), 0) +const deltaExtensions = throttle( + async ({ toAdd, toRemove }: ExtensionDelta) => { + await waitServicesReady() + const extensionService = StandaloneServices.get(IExtensionService) as ExtensionServiceOverride + await extensionService.deltaExtensions(toAdd, toRemove) + }, + (a, b) => ({ toAdd: [...a.toAdd, ...b.toAdd], toRemove: [...a.toRemove, ...b.toRemove] }), + 0 +) -export async function registerRemoteExtension (directory: string): Promise { +export async function registerRemoteExtension( + directory: string +): Promise { await waitServicesReady() const fileService = StandaloneServices.get(IFileService) const remoteAuthority = StandaloneServices.get(IWorkbenchEnvironmentService).remoteAuthority - const content = await fileService.readFile(joinPath(URI.from({ scheme: Schemas.vscodeRemote, authority: remoteAuthority, path: directory }), 'package.json')) + const content = await fileService.readFile( + joinPath( + URI.from({ scheme: Schemas.vscodeRemote, authority: remoteAuthority, path: directory }), + 'package.json' + ) + ) const manifest: IExtensionManifest = parse(content.value.toString()) return registerExtension(manifest, ExtensionHostKind.Remote, { path: directory }) @@ -92,18 +128,38 @@ export async function registerRemoteExtension (directory: string): Promise() const extensions: IExtension[] = [] -export function getExtensionManifests (): IExtension[] { +export function getExtensionManifests(): IExtension[] { return extensions } -export function getForcedExtensionHostKind (id: string): ExtensionHostKind | undefined { +export function getForcedExtensionHostKind(id: string): ExtensionHostKind | undefined { return forcedExtensionHostKinds.get(id) } -export function registerExtension (manifest: IExtensionManifest, extHostKind: ExtensionHostKind.LocalProcess, params?: RegisterExtensionParams): RegisterLocalProcessExtensionResult -export function registerExtension (manifest: IExtensionManifest, extHostKind: ExtensionHostKind.LocalWebWorker, params?: RegisterExtensionParams): RegisterLocalExtensionResult -export function registerExtension (manifest: IExtensionManifest, extHostKind: ExtensionHostKind.Remote, params?: RegisterRemoteExtensionParams): RegisterRemoteExtensionResult -export function registerExtension (manifest: IExtensionManifest, extHostKind?: ExtensionHostKind, params?: RegisterExtensionParams): RegisterExtensionResult -export function registerExtension (manifest: IExtensionManifest, extHostKind?: ExtensionHostKind, { path = '/', system = false, readmePath, changelogPath }: RegisterExtensionParams = {}): RegisterExtensionResult { +export function registerExtension( + manifest: IExtensionManifest, + extHostKind: ExtensionHostKind.LocalProcess, + params?: RegisterExtensionParams +): RegisterLocalProcessExtensionResult +export function registerExtension( + manifest: IExtensionManifest, + extHostKind: ExtensionHostKind.LocalWebWorker, + params?: RegisterExtensionParams +): RegisterLocalExtensionResult +export function registerExtension( + manifest: IExtensionManifest, + extHostKind: ExtensionHostKind.Remote, + params?: RegisterRemoteExtensionParams +): RegisterRemoteExtensionResult +export function registerExtension( + manifest: IExtensionManifest, + extHostKind?: ExtensionHostKind, + params?: RegisterExtensionParams +): RegisterExtensionResult +export function registerExtension( + manifest: IExtensionManifest, + extHostKind?: ExtensionHostKind, + { path = '/', system = false, readmePath, changelogPath }: RegisterExtensionParams = {} +): RegisterExtensionResult { const id = getExtensionId(manifest.publisher, manifest.name) const location = URI.from({ scheme: CustomSchemas.extensionFile, authority: id, path }) @@ -124,7 +180,11 @@ export function registerExtension (manifest: IExtensionManifest, extHostKind?: E pseudo: platform.language === 'pseudo', translations: getBuiltInExtensionTranslationsUris(platform.language) ?? {} } - const localizedManifest = await translator.translateManifest(realLocation, manifest, nlsConfiguration) + const localizedManifest = await translator.translateManifest( + realLocation, + manifest, + nlsConfiguration + ) const extension: IExtensionWithExtHostKind = { manifest: localizedManifest, @@ -158,16 +218,18 @@ export function registerExtension (manifest: IExtensionManifest, extHostKind?: E let api: RegisterExtensionResult = { id, - async whenReady () { + async whenReady() { await addExtensionPromise }, - async isEnabled () { + async isEnabled() { await waitServicesReady() - const extensionEnablementService = StandaloneServices.get(IWorkbenchExtensionEnablementService) + const extensionEnablementService = StandaloneServices.get( + IWorkbenchExtensionEnablementService + ) const extension = await addExtensionPromise return extensionEnablementService.isEnabled(extension) }, - async dispose () { + async dispose() { const extension = await addExtensionPromise const index = extensions.indexOf(extension) @@ -181,7 +243,11 @@ export function registerExtension (manifest: IExtensionManifest, extHostKind?: E } if (extHostKind !== ExtensionHostKind.Remote) { - function registerFileUrl (path: string, url: string, metadataOrMimeType?: string | ExtensionFileMetadata) { + function registerFileUrl( + path: string, + url: string, + metadataOrMimeType?: string | ExtensionFileMetadata + ) { return registerExtensionFileUrl(location, path, url, metadataOrMimeType) } api = { @@ -191,10 +257,12 @@ export function registerExtension (manifest: IExtensionManifest, extHostKind?: E } if (extHostKind === ExtensionHostKind.LocalProcess) { - async function getApi () { + async function getApi() { await addExtensionPromise if (apiFactory == null) { - throw new Error('The local api can\'t be used without registering the local extension host by importing `vscode/localExtensionHost`') + throw new Error( + "The local api can't be used without registering the local extension host by importing `vscode/localExtensionHost`" + ) } return await apiFactory(id) } @@ -202,7 +270,7 @@ export function registerExtension (manifest: IExtensionManifest, extHostKind?: E api = { ...api, getApi, - async setAsDefaultApi () { + async setAsDefaultApi() { setDefaultApi(await getApi()) } } diff --git a/src/l10n.ts b/src/l10n.ts index 8760f7ee..cf79f2bb 100644 --- a/src/l10n.ts +++ b/src/l10n.ts @@ -4,11 +4,11 @@ const extensionTranslationsUri: Record> = {} let currentLocaleExtensionId: string | undefined let availableLocales: Set = new Set() -function setAvailableLocales (locales: Set): void { +function setAvailableLocales(locales: Set): void { availableLocales = locales } -function isLocaleAvailable (locale: string): boolean { +function isLocaleAvailable(locale: string): boolean { return availableLocales.has(locale) } @@ -27,9 +27,16 @@ declare global { var _VSCODE_NLS_LANGUAGE: string | undefined } -function registerLocalization (extensionId: string, language: string, main: string[], extensionTranslationsUris: Record): void { +function registerLocalization( + extensionId: string, + language: string, + main: string[], + extensionTranslationsUris: Record +): void { if (isInitialized()) { - console.error('Some parts of VSCode are already initialized, make sure the language pack is loaded before anything else or some translations will be missing') + console.error( + 'Some parts of VSCode are already initialized, make sure the language pack is loaded before anything else or some translations will be missing' + ) } globalThis._VSCODE_NLS_MESSAGES = main globalThis._VSCODE_NLS_LANGUAGE = language @@ -38,11 +45,11 @@ function registerLocalization (extensionId: string, language: string, main: stri currentLocaleExtensionId = extensionId } -function getBuiltInExtensionTranslationsUris (language: string): Record | undefined { +function getBuiltInExtensionTranslationsUris(language: string): Record | undefined { return extensionTranslationsUri[language] } -function getExtensionIdProvidingCurrentLocale (): string | undefined { +function getExtensionIdProvidingCurrentLocale(): string | undefined { return currentLocaleExtensionId } diff --git a/src/lifecycle.ts b/src/lifecycle.ts index c92bf196..f015d893 100644 --- a/src/lifecycle.ts +++ b/src/lifecycle.ts @@ -1,8 +1,14 @@ import { Registry } from 'vs/platform/registry/common/platform' -import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions' +import { + IWorkbenchContributionsRegistry, + Extensions as WorkbenchExtensions +} from 'vs/workbench/common/contributions' import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle' import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle.service' -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' +import { + IInstantiationService, + ServicesAccessor +} from 'vs/platform/instantiation/common/instantiation' import { Barrier, RunOnceScheduler, _runWhenIdle, timeout } from 'vs/base/common/async' import { Emitter } from 'vs/base/common/event' import { EditorExtensions, IEditorFactoryRegistry } from 'vs/workbench/common/editor' @@ -29,43 +35,51 @@ interface ServiceInitializeParticipant { const serviceInitializePreParticipants: ServiceInitializeParticipant[] = [] const serviceInitializeParticipants: ServiceInitializeParticipant[] = [] const serviceInitializePostParticipants: ServiceInitializeParticipant[] = [] -export function registerServiceInitializePreParticipant (participant: ServiceInitializeParticipant): void { +export function registerServiceInitializePreParticipant( + participant: ServiceInitializeParticipant +): void { serviceInitializePreParticipants.push(participant) } -export function registerServiceInitializeParticipant (participant: ServiceInitializeParticipant): void { +export function registerServiceInitializeParticipant( + participant: ServiceInitializeParticipant +): void { serviceInitializeParticipants.push(participant) } -export function registerServiceInitializePostParticipant (participant: ServiceInitializeParticipant): void { +export function registerServiceInitializePostParticipant( + participant: ServiceInitializeParticipant +): void { serviceInitializePostParticipants.push(participant) } -export async function startup (instantiationService: IInstantiationService): Promise { - await instantiationService.invokeFunction(async accessor => { - await Promise.all(serviceInitializePreParticipants.map(participant => participant(accessor))) +export async function startup(instantiationService: IInstantiationService): Promise { + await instantiationService.invokeFunction(async (accessor) => { + await Promise.all(serviceInitializePreParticipants.map((participant) => participant(accessor))) }) - await instantiationService.invokeFunction(async accessor => { - setHoverDelegateFactory((placement, enableInstantHover) => instantiationService.createInstance(WorkbenchHoverDelegate, placement, enableInstantHover, {})) + await instantiationService.invokeFunction(async (accessor) => { + setHoverDelegateFactory((placement, enableInstantHover) => + instantiationService.createInstance(WorkbenchHoverDelegate, placement, enableInstantHover, {}) + ) setBaseLayerHoverDelegate(accessor.get(IHoverService)) }) - await instantiationService.invokeFunction(async accessor => { + await instantiationService.invokeFunction(async (accessor) => { const lifecycleService = accessor.get(ILifecycleService) - await Promise.all(serviceInitializeParticipants.map(participant => participant(accessor))) + await Promise.all(serviceInitializeParticipants.map((participant) => participant(accessor))) // Signal to lifecycle that services are set lifecycleService.phase = LifecyclePhase.Ready }) - await instantiationService.invokeFunction(async accessor => { - await Promise.all(serviceInitializePostParticipants.map(participant => participant(accessor))) + await instantiationService.invokeFunction(async (accessor) => { + await Promise.all(serviceInitializePostParticipants.map((participant) => participant(accessor))) }) serviceInitializedBarrier.open() serviceInitializedEmitter.fire() - void instantiationService.invokeFunction(async accessor => { + void instantiationService.invokeFunction(async (accessor) => { const lifecycleService = accessor.get(ILifecycleService) Registry.as(WorkbenchExtensions.Workbench).start(accessor) @@ -74,18 +88,19 @@ export async function startup (instantiationService: IInstantiationService): Pro layoutEmitter.fire(accessor) renderWorkbenchEmitter.fire(accessor) - await Promise.race([ - accessor.get(IWorkbenchLayoutService).whenRestored, - timeout(2000) - ]) + await Promise.race([accessor.get(IWorkbenchLayoutService).whenRestored, timeout(2000)]) lifecycleService.phase = LifecyclePhase.Restored // Set lifecycle phase to `Eventually` after a short delay and when idle (min 2.5sec, max 5sec) const eventuallyPhaseScheduler = new RunOnceScheduler(() => { - _runWhenIdle(window, () => { - lifecycleService.phase = LifecyclePhase.Eventually - }, 2500) + _runWhenIdle( + window, + () => { + lifecycleService.phase = LifecyclePhase.Eventually + }, + 2500 + ) }, 2500) eventuallyPhaseScheduler.schedule() }) @@ -97,17 +112,17 @@ StandaloneServices.withServices(() => { return Disposable.None }) -export async function waitServicesReady (): Promise { +export async function waitServicesReady(): Promise { await serviceInitializedBarrier.wait() } -export function checkServicesReady (): void { +export function checkServicesReady(): void { if (!serviceInitializedBarrier.isOpen()) { throw new Error('Services are not ready yet') } } -export function checkServicesNotInitialized (): void { +export function checkServicesNotInitialized(): void { if (servicesInitialized) { throw new Error('Services are already initialized') } diff --git a/src/localExtensionHost.ts b/src/localExtensionHost.ts index a3ad957a..55e14893 100644 --- a/src/localExtensionHost.ts +++ b/src/localExtensionHost.ts @@ -8,12 +8,23 @@ import { BufferedEmitter } from 'vs/base/parts/ipc/common/ipc.net' import { VSBuffer } from 'vs/base/common/buffer' import { isLoggingOnly } from 'vs/platform/telemetry/common/telemetryUtils' import { joinPath } from 'vs/base/common/resources' -import { IExtensionHostInitData, UIKind } from 'vs/workbench/services/extensions/common/extensionHostProtocol' +import { + IExtensionHostInitData, + UIKind +} from 'vs/workbench/services/extensions/common/extensionHostProtocol' import * as platform from 'vs/base/common/platform' import { IMessagePassingProtocol } from 'vs/base/parts/ipc/common/ipc' import { LocalProcessRunningLocation } from 'vs/workbench/services/extensions/common/extensionRunningLocation' -import { IExtHostExtensionService, IHostUtils } from 'vs/workbench/api/common/extHostExtensionService' -import { ExtensionHostExtensions, ExtensionHostStartup, IExtensionHost, nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions' +import { + IExtHostExtensionService, + IHostUtils +} from 'vs/workbench/api/common/extHostExtensionService' +import { + ExtensionHostExtensions, + ExtensionHostStartup, + IExtensionHost, + nullExtensionDescription +} from 'vs/workbench/services/extensions/common/extensions' import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions.service' import { IWebWorkerExtensionHostDataProvider } from 'vs/workbench/services/extensions/browser/webWorkerExtensionHost' import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry.service' @@ -27,7 +38,10 @@ import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/use import { URI } from 'vs/base/common/uri' import { Event } from 'vs/base/common/event' import { InstantiationType, registerSingleton } from 'vs/platform/instantiation/common/extensions' -import { ExtensionStoragePaths, IExtensionStoragePaths } from 'vs/workbench/api/common/extHostStoragePaths' +import { + ExtensionStoragePaths, + IExtensionStoragePaths +} from 'vs/workbench/api/common/extHostStoragePaths' import { ExtHostExtensionService } from 'vs/workbench/api/worker/extHostExtensionService' import { ExtensionIdentifierMap } from 'vs/platform/extensions/common/extensions' import { DeferredPromise } from 'vs/base/common/async' @@ -44,7 +58,7 @@ class LocalExtHostExtensionService extends ExtHostExtensionService { private readonly _extApiImpl = new ExtensionIdentifierMap() - public async getApi (extensionId?: string): Promise { + public async getApi(extensionId?: string): Promise { const [myRegistry, configProvider] = await Promise.all([ this.getExtensionRegistry(), this._extHostConfiguration.getConfigProvider() @@ -53,7 +67,11 @@ class LocalExtHostExtensionService extends ExtHostExtensionService { if (extensionId == null) { if (this._defaultApiImpl == null) { - this._defaultApiImpl = this._apiFactory!(nullExtensionDescription, extensionRegistry, configProvider) + this._defaultApiImpl = this._apiFactory!( + nullExtensionDescription, + extensionRegistry, + configProvider + ) } return this._defaultApiImpl } @@ -74,39 +92,42 @@ class LocalExtHostExtensionService extends ExtHostExtensionService { registerSingleton(IExtHostExtensionService, LocalExtHostExtensionService, InstantiationType.Eager) registerSingleton(IExtensionStoragePaths, ExtensionStoragePaths, InstantiationType.Eager) -function createMessagePassingProtocolPair (): [IMessagePassingProtocol, IMessagePassingProtocol] { +function createMessagePassingProtocolPair(): [IMessagePassingProtocol, IMessagePassingProtocol] { const emitterA = new BufferedEmitter() const emitterB = new BufferedEmitter() class SimpleMessagePassingProtocol implements IMessagePassingProtocol { - constructor ( + constructor( private readonly emitterIn: BufferedEmitter, private readonly emitterOut: BufferedEmitter ) {} - send (buffer: VSBuffer): void { + send(buffer: VSBuffer): void { this.emitterOut.fire(buffer) } onMessage = this.emitterIn.event } - return [new SimpleMessagePassingProtocol(emitterA, emitterB), new SimpleMessagePassingProtocol(emitterB, emitterA)] + return [ + new SimpleMessagePassingProtocol(emitterA, emitterB), + new SimpleMessagePassingProtocol(emitterB, emitterA) + ] } -const hostUtil = new class implements IHostUtils { +const hostUtil = new (class implements IHostUtils { declare readonly _serviceBrand: undefined public readonly pid = undefined exit = unsupported - async exists (_path: string): Promise { + async exists(_path: string): Promise { return true } - async realpath (path: string): Promise { + async realpath(path: string): Promise { return path } -}() +})() class LocalExtensionHost implements IExtensionHost { public readonly remoteAuthority = null @@ -115,7 +136,7 @@ class LocalExtensionHost implements IExtensionHost { private _protocolPromise: Promise | null public pid = null - constructor ( + constructor( public readonly runningLocation: LocalProcessRunningLocation, public readonly startup: ExtensionHostStartup, private readonly _initDataProvider: IWebWorkerExtensionHostDataProvider, @@ -124,7 +145,8 @@ class LocalExtensionHost implements IExtensionHost { @ILabelService private readonly _labelService: ILabelService, @ILogService private readonly _logService: ILogService, @ILoggerService private readonly _loggerService: ILoggerService, - @IBrowserWorkbenchEnvironmentService private readonly _environmentService: IBrowserWorkbenchEnvironmentService, + @IBrowserWorkbenchEnvironmentService + private readonly _environmentService: IBrowserWorkbenchEnvironmentService, @IProductService private readonly _productService: IProductService, @IUserDataProfilesService private readonly _userDataProfilesService: IUserDataProfilesService ) { @@ -133,40 +155,48 @@ class LocalExtensionHost implements IExtensionHost { } onExit = Event.None - public async start (): Promise { + public async start(): Promise { if (this._protocolPromise == null) { this._protocolPromise = this._start() } return await this._protocolPromise } - async _start (): Promise { - const [mainThreadMessagePassingProtocol, extHostMessagePassingProtocol] = createMessagePassingProtocolPair() + async _start(): Promise { + const [mainThreadMessagePassingProtocol, extHostMessagePassingProtocol] = + createMessagePassingProtocolPair() const initData = await this._createExtHostInitData() - const hostMain = new ExtensionHostMain( - extHostMessagePassingProtocol, - initData, - hostUtil, - null - ) + const hostMain = new ExtensionHostMain(extHostMessagePassingProtocol, initData, hostUtil, null) - const localExtHostExtensionService = hostMain.getExtHostExtensionService() as LocalExtHostExtensionService + const localExtHostExtensionService = + hostMain.getExtHostExtensionService() as LocalExtHostExtensionService - await apiFactoryDeferred.complete((extensionId?: string) => localExtHostExtensionService.getApi(extensionId)) + await apiFactoryDeferred.complete((extensionId?: string) => + localExtHostExtensionService.getApi(extensionId) + ) return mainThreadMessagePassingProtocol } - private async _createExtHostInitData (): Promise { + private async _createExtHostInitData(): Promise { const initData = await this._initDataProvider.getInitData() this.extensions = initData.extensions const workspace = this._contextService.getWorkspace() const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl let nlsUrlWithDetails: URI | undefined // Only use the nlsBaseUrl if we are using a language other than the default, English. - if (nlsBaseUrl != null && this._productService.commit != null && !platform.Language.isDefaultVariant()) { - nlsUrlWithDetails = URI.joinPath(URI.parse(nlsBaseUrl), this._productService.commit, this._productService.version, platform.Language.value()) + if ( + nlsBaseUrl != null && + this._productService.commit != null && + !platform.Language.isDefaultVariant() + ) { + nlsUrlWithDetails = URI.joinPath( + URI.parse(nlsBaseUrl), + this._productService.commit, + this._productService.version, + platform.Language.value() + ) } return { commit: this._productService.commit, @@ -180,21 +210,25 @@ class LocalExtensionHost implements IExtensionHost { appUriScheme: this._productService.urlProtocol, appLanguage: platform.language, extensionTelemetryLogResource: this._environmentService.extHostTelemetryLogFile, - isExtensionTelemetryLoggingOnly: isLoggingOnly(this._productService, this._environmentService), + isExtensionTelemetryLoggingOnly: isLoggingOnly( + this._productService, + this._environmentService + ), extensionDevelopmentLocationURI: this._environmentService.extensionDevelopmentLocationURI, extensionTestsLocationURI: this._environmentService.extensionTestsLocationURI, globalStorageHome: this._userDataProfilesService.defaultProfile.globalStorageHome, workspaceStorageHome: this._environmentService.workspaceStorageHome, extensionLogLevel: this._environmentService.extensionLogLevel }, - workspace: this._contextService.getWorkbenchState() === WorkbenchState.EMPTY - ? undefined - : { - configuration: workspace.configuration ?? undefined, - id: workspace.id, - name: this._labelService.getWorkspaceLabel(workspace), - transient: workspace.transient - }, + workspace: + this._contextService.getWorkbenchState() === WorkbenchState.EMPTY + ? undefined + : { + configuration: workspace.configuration ?? undefined, + id: workspace.id, + name: this._labelService.getWorkspaceLabel(workspace), + transient: workspace.transient + }, consoleForward: { includeStack: false, logNative: this._environmentService.debugRenderer @@ -212,7 +246,7 @@ class LocalExtensionHost implements IExtensionHost { logLevel: this._logService.getLevel(), loggers: [...this._loggerService.getRegisteredLoggers()], logsLocation: this._extensionHostLogsLocation, - autoStart: (this.startup === ExtensionHostStartup.EagerAutoStart), + autoStart: this.startup === ExtensionHostStartup.EagerAutoStart, remote: { authority: this._environmentService.remoteAuthority, connectionData: null, @@ -222,23 +256,20 @@ class LocalExtensionHost implements IExtensionHost { } } - getInspectPort (): { port: number, host: string } | undefined { + getInspectPort(): { port: number; host: string } | undefined { return undefined } - enableInspectPort (): Promise { + enableInspectPort(): Promise { return Promise.resolve(false) } - dispose (): void { - } + dispose(): void {} } -export type { - LocalExtensionHost -} +export type { LocalExtensionHost } -async function createLocalApi (extensionId?: string): Promise { +async function createLocalApi(extensionId?: string): Promise { const apiFactory = await apiFactoryDeferred.p return await apiFactory(extensionId) } diff --git a/src/missing-services.ts b/src/missing-services.ts index 69b6fba9..34b57388 100644 --- a/src/missing-services.ts +++ b/src/missing-services.ts @@ -1,5 +1,9 @@ import { mainWindow } from 'vs/base/browser/window' -import { DynamicListEventMultiplexer, Event, IDynamicListEventMultiplexer } from 'vs/base/common/event' +import { + DynamicListEventMultiplexer, + Event, + IDynamicListEventMultiplexer +} from 'vs/base/common/event' import { Disposable, IDisposable } from 'vs/base/common/lifecycle' import { ResourceSet } from 'vs/base/common/map' import { OS } from 'vs/base/common/platform' @@ -18,7 +22,11 @@ import { IDownloadService } from 'vs/platform/download/common/download.service' import { IEncryptionService } from 'vs/platform/encryption/common/encryptionService.service' import { IEnvironmentService } from 'vs/platform/environment/common/environment.service' import { ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement' -import { IExtensionGalleryService, IExtensionTipsService, IGlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement.service' +import { + IExtensionGalleryService, + IExtensionTipsService, + IGlobalExtensionEnablementService +} from 'vs/platform/extensionManagement/common/extensionManagement.service' import { IExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage.service' import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService.service' import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService.service' @@ -56,21 +64,49 @@ import { IURLService } from 'vs/platform/url/common/url.service' import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile.service' import { IIgnoredExtensionsManagementService } from 'vs/platform/userDataSync/common/ignoredExtensions.service' import { SyncStatus } from 'vs/platform/userDataSync/common/userDataSync' -import { IUserDataAutoSyncService, IUserDataSyncEnablementService, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncResourceProviderService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService, IUserDataSyncUtilService } from 'vs/platform/userDataSync/common/userDataSync.service' +import { + IUserDataAutoSyncService, + IUserDataSyncEnablementService, + IUserDataSyncLocalStoreService, + IUserDataSyncLogService, + IUserDataSyncResourceProviderService, + IUserDataSyncService, + IUserDataSyncStoreManagementService, + IUserDataSyncStoreService, + IUserDataSyncUtilService +} from 'vs/platform/userDataSync/common/userDataSync.service' import { IUserDataSyncAccountService } from 'vs/platform/userDataSync/common/userDataSyncAccount.service' import { IUserDataSyncMachinesService } from 'vs/platform/userDataSync/common/userDataSyncMachines.service' import { ICanonicalUriService } from 'vs/platform/workspace/common/canonicalUri.service' import { IEditSessionIdentityService } from 'vs/platform/workspace/common/editSessions.service' import { WorkspaceTrustUriResponse } from 'vs/platform/workspace/common/workspaceTrust' -import { IWorkspaceTrustEnablementService, IWorkspaceTrustRequestService } from 'vs/platform/workspace/common/workspaceTrust.service' +import { + IWorkspaceTrustEnablementService, + IWorkspaceTrustRequestService +} from 'vs/platform/workspace/common/workspaceTrust.service' import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces.service' -import { ExtensionStatusBarEntry, IExtensionStatusBarItemService, StatusBarUpdateKind } from 'vs/workbench/api/browser/statusBarService' +import { + ExtensionStatusBarEntry, + IExtensionStatusBarItemService, + StatusBarUpdateKind +} from 'vs/workbench/api/browser/statusBarService' import { IBreadcrumbsService } from 'vs/workbench/browser/parts/editor/breadcrumbs.service' -import { DEFAULT_EDITOR_PART_OPTIONS, IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor' +import { + DEFAULT_EDITOR_PART_OPTIONS, + IEditorGroupView +} from 'vs/workbench/browser/parts/editor/editor' import { IViewDescriptorService } from 'vs/workbench/common/views.service' import { IAccessibleViewService } from 'vs/platform/accessibility/browser/accessibleView.service' -import { IChatAccessibilityService, IChatCodeBlockContextProviderService, IChatWidgetService, IQuickChatService } from 'vs/workbench/contrib/chat/browser/chat.service' -import { IChatAgentNameService, IChatAgentService } from 'vs/workbench/contrib/chat/common/chatAgents.service' +import { + IChatAccessibilityService, + IChatCodeBlockContextProviderService, + IChatWidgetService, + IQuickChatService +} from 'vs/workbench/contrib/chat/browser/chat.service' +import { + IChatAgentNameService, + IChatAgentService +} from 'vs/workbench/contrib/chat/common/chatAgents.service' import { IChatService } from 'vs/workbench/contrib/chat/common/chatService.service' import { IChatSlashCommandService } from 'vs/workbench/contrib/chat/common/chatSlashCommands.service' import { IChatVariablesService } from 'vs/workbench/contrib/chat/common/chatVariables.service' @@ -80,7 +116,10 @@ import { ICommentService } from 'vs/workbench/contrib/comments/browser/commentSe import { ICustomEditorService } from 'vs/workbench/contrib/customEditor/common/customEditor.service' import { IDebugService } from 'vs/workbench/contrib/debug/common/debug.service' import { IDebugVisualizerService } from 'vs/workbench/contrib/debug/common/debugVisualizers.service' -import { IEditSessionsLogService, IEditSessionsStorageService } from 'vs/workbench/contrib/editSessions/common/editSessions.service' +import { + IEditSessionsLogService, + IEditSessionsStorageService +} from 'vs/workbench/contrib/editSessions/common/editSessions.service' import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions.service' import { IExternalUriOpenerService } from 'vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.service' import { IExplorerService } from 'vs/workbench/contrib/files/browser/files.service' @@ -95,7 +134,10 @@ import { INotebookCellStatusBarService } from 'vs/workbench/contrib/notebook/com import { INotebookEditorModelResolverService } from 'vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service' import { INotebookExecutionService } from 'vs/workbench/contrib/notebook/common/notebookExecutionService.service' import { INotebookExecutionStateService } from 'vs/workbench/contrib/notebook/common/notebookExecutionStateService.service' -import { INotebookKernelHistoryService, INotebookKernelService } from 'vs/workbench/contrib/notebook/common/notebookKernelService.service' +import { + INotebookKernelHistoryService, + INotebookKernelService +} from 'vs/workbench/contrib/notebook/common/notebookKernelService.service' import { INotebookKeymapService } from 'vs/workbench/contrib/notebook/common/notebookKeymapService.service' import { INotebookLoggingService } from 'vs/workbench/contrib/notebook/common/notebookLoggingService.service' import { INotebookRendererMessagingService } from 'vs/workbench/contrib/notebook/common/notebookRendererMessagingService.service' @@ -115,9 +157,18 @@ import { ISpeechService } from 'vs/workbench/contrib/speech/common/speechService import { NoOpWorkspaceTagsService } from 'vs/workbench/contrib/tags/browser/workspaceTagsService' import { IWorkspaceTagsService } from 'vs/workbench/contrib/tags/common/workspaceTags.service' import { ITaskService } from 'vs/workbench/contrib/tasks/common/taskService.service' -import { ITerminalConfigurationService, ITerminalEditorService, ITerminalGroupService, ITerminalInstanceService, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal.service' +import { + ITerminalConfigurationService, + ITerminalEditorService, + ITerminalGroupService, + ITerminalInstanceService, + ITerminalService +} from 'vs/workbench/contrib/terminal/browser/terminal.service' import { IEnvironmentVariableService } from 'vs/workbench/contrib/terminal/common/environmentVariable.service' -import { ITerminalProfileResolverService, ITerminalProfileService } from 'vs/workbench/contrib/terminal/common/terminal.service' +import { + ITerminalProfileResolverService, + ITerminalProfileService +} from 'vs/workbench/contrib/terminal/common/terminal.service' import { ITerminalContributionService } from 'vs/workbench/contrib/terminal/common/terminalExtensionPoints.service' import { ITerminalLinkProviderService } from 'vs/workbench/contrib/terminalContrib/links/browser/links.service' import { ITerminalQuickFixService } from 'vs/workbench/contrib/terminalContrib/quickFix/browser/quickFix.service' @@ -141,7 +192,10 @@ import { IAiRelatedInformationService } from 'vs/workbench/services/aiRelatedInf import { IWorkbenchAssignmentService } from 'vs/workbench/services/assignment/common/assignmentService.service' import { IAuthenticationAccessService } from 'vs/workbench/services/authentication/browser/authenticationAccessService.service' import { IAuthenticationUsageService } from 'vs/workbench/services/authentication/browser/authenticationUsageService.service' -import { IAuthenticationExtensionsService, IAuthenticationService } from 'vs/workbench/services/authentication/common/authentication.service' +import { + IAuthenticationExtensionsService, + IAuthenticationService +} from 'vs/workbench/services/authentication/common/authentication.service' import { IAuxiliaryWindowService } from 'vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.service' import { IBannerService } from 'vs/workbench/services/banner/browser/bannerService.service' import { IJSONEditingService } from 'vs/workbench/services/configuration/common/jsonEditing.service' @@ -155,8 +209,16 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { IExtensionBisectService } from 'vs/workbench/services/extensionManagement/browser/extensionBisect.service' import { IExtensionFeaturesManagementService } from 'vs/workbench/services/extensionManagement/common/extensionFeatures.service' import { EnablementState } from 'vs/workbench/services/extensionManagement/common/extensionManagement' -import { IExtensionManagementServerService, IWebExtensionsScannerService, IWorkbenchExtensionEnablementService, IWorkbenchExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement.service' -import { IExtensionIgnoredRecommendationsService, IExtensionRecommendationsService } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations.service' +import { + IExtensionManagementServerService, + IWebExtensionsScannerService, + IWorkbenchExtensionEnablementService, + IWorkbenchExtensionManagementService +} from 'vs/workbench/services/extensionManagement/common/extensionManagement.service' +import { + IExtensionIgnoredRecommendationsService, + IExtensionRecommendationsService +} from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations.service' import { IWorkspaceExtensionsConfigService } from 'vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.service' import { IExtensionUrlHandler } from 'vs/workbench/services/extensions/browser/extensionUrlHandler.service' import { IExtensionManifestPropertiesService } from 'vs/workbench/services/extensions/common/extensionManifestPropertiesService.service' @@ -166,14 +228,20 @@ import { IFilesConfigurationService } from 'vs/workbench/services/filesConfigura import { IHistoryService } from 'vs/workbench/services/history/common/history.service' import { IHostService } from 'vs/workbench/services/host/browser/host.service' import { ITroubleshootIssueService } from 'vs/workbench/contrib/issue/browser/issueTroubleshoot.service' -import { IIssueFormService, IWorkbenchIssueService } from 'vs/workbench/contrib/issue/common/issue.service' +import { + IIssueFormService, + IWorkbenchIssueService +} from 'vs/workbench/contrib/issue/common/issue.service' import { FallbackKeyboardMapper } from 'vs/workbench/services/keybinding/common/fallbackKeyboardMapper' import { IKeybindingEditingService } from 'vs/workbench/services/keybinding/common/keybindingEditing.service' import { ILanguageDetectionService } from 'vs/workbench/services/languageDetection/common/languageDetectionWorkerService.service' import { ILanguageStatusService } from 'vs/workbench/services/languageStatus/common/languageStatusService.service' import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle.service' import { AbstractLifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycleService' -import { IActiveLanguagePackService, ILocaleService } from 'vs/workbench/services/localization/common/locale.service' +import { + IActiveLanguagePackService, + ILocaleService +} from 'vs/workbench/services/localization/common/locale.service' import { INotebookDocumentService } from 'vs/workbench/services/notebook/common/notebookDocumentService.service' import { IOutlineService } from 'vs/workbench/services/outline/browser/outline.service' import { IOutputService } from 'vs/workbench/services/output/common/output.service' @@ -195,11 +263,18 @@ import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/commo import { IUserActivityService } from 'vs/workbench/services/userActivity/common/userActivityService.service' import { IUserDataInitializationService } from 'vs/workbench/services/userData/browser/userDataInit.service' import { IRemoteUserDataProfilesService } from 'vs/workbench/services/userDataProfile/common/remoteUserDataProfiles.service' -import { IUserDataProfileImportExportService, IUserDataProfileManagementService, IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile.service' +import { + IUserDataProfileImportExportService, + IUserDataProfileManagementService, + IUserDataProfileService +} from 'vs/workbench/services/userDataProfile/common/userDataProfile.service' import { UserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfileService' import { IUserDataSyncWorkbenchService } from 'vs/workbench/services/userDataSync/common/userDataSync.service' import { IViewsService } from 'vs/workbench/services/views/common/viewsService.service' -import { IWorkingCopyBackupMeta, IWorkingCopyIdentifier } from 'vs/workbench/services/workingCopy/common/workingCopy' +import { + IWorkingCopyBackupMeta, + IWorkingCopyIdentifier +} from 'vs/workbench/services/workingCopy/common/workingCopy' import { IResolvedWorkingCopyBackup } from 'vs/workbench/services/workingCopy/common/workingCopyBackup' import { IWorkingCopyBackupService } from 'vs/workbench/services/workingCopy/common/workingCopyBackup.service' import { IWorkingCopyEditorService } from 'vs/workbench/services/workingCopy/common/workingCopyEditorService.service' @@ -208,14 +283,24 @@ import { IWorkingCopyHistoryService } from 'vs/workbench/services/workingCopy/co import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService.service' import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing.service' import { IWorkspaceIdentityService } from 'vs/workbench/services/workspaces/common/workspaceIdentityService.service' -import { IEditorGroup, GroupOrientation, IEditorPart } from 'vs/workbench/services/editor/common/editorGroupsService' +import { + IEditorGroup, + GroupOrientation, + IEditorPart +} from 'vs/workbench/services/editor/common/editorGroupsService' import { NullExtensionService } from 'vs/workbench/services/extensions/common/extensions' import { toUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile' import { IAdapterManager, IDebugModel, IViewModel } from 'vs/workbench/contrib/debug/common/debug' import { IViewContainerModel } from 'vs/workbench/common/views' import { ISearchComplete } from 'vs/workbench/services/search/common/search' -import { IOutputChannel, IOutputChannelDescriptor } from 'vs/workbench/services/output/common/output' -import { ITerminalInstance, TerminalConnectionState } from 'vs/workbench/contrib/terminal/browser/terminal' +import { + IOutputChannel, + IOutputChannelDescriptor +} from 'vs/workbench/services/output/common/output' +import { + ITerminalInstance, + TerminalConnectionState +} from 'vs/workbench/contrib/terminal/browser/terminal' import { AccountStatus } from 'vs/workbench/services/userDataSync/common/userDataSync' import { IWebview } from 'vs/workbench/contrib/webview/browser/webview' import { SyncResource } from 'vs/workbench/contrib/editSessions/common/editSessions' @@ -234,135 +319,160 @@ import { ITreeSitterTokenizationFeature } from 'vs/workbench/services/treeSitter import { getBuiltInExtensionTranslationsUris, getExtensionIdProvidingCurrentLocale } from './l10n' import { unsupported } from './tools' -registerSingleton(ILoggerService, class NullLoggerService extends AbstractLoggerService { - constructor () { - super(LogLevel.Info, URI.file('logs.log')) - } - - protected doCreateLogger (): ILogger { return new NullLogger() } -}, InstantiationType.Eager) - -registerSingleton(IEditorService, class EditorService implements IEditorService { - readonly _serviceBrand = undefined +registerSingleton( + ILoggerService, + class NullLoggerService extends AbstractLoggerService { + constructor() { + super(LogLevel.Info, URI.file('logs.log')) + } - onWillOpenEditor = Event.None - onDidActiveEditorChange = Event.None - onDidVisibleEditorsChange = Event.None - onDidEditorsChange = Event.None - onDidCloseEditor = Event.None - activeEditorPane = undefined - activeEditor = undefined - get activeTextEditorControl () { return StandaloneServices.get(ICodeEditorService).getFocusedCodeEditor() ?? undefined } - activeTextEditorLanguageId = undefined - visibleEditorPanes = [] - visibleEditors = [] - visibleTextEditorControls = [] - editors = [] - count = 0 - getEditors = () => [] - openEditor = unsupported - openEditors = unsupported - replaceEditors = async () => {} - isOpened = () => false - isVisible = () => false - closeEditor = async () => {} - closeEditors = async () => {} - findEditors = () => [] - save = async () => ({ success: false, editors: [] }) - saveAll = async () => ({ success: false, editors: [] }) - revert = async () => false - revertAll = async () => false - createScoped (): IEditorService { - return this - } -}, InstantiationType.Eager) + protected doCreateLogger(): ILogger { + return new NullLogger() + } + }, + InstantiationType.Eager +) + +registerSingleton( + IEditorService, + class EditorService implements IEditorService { + readonly _serviceBrand = undefined + + onWillOpenEditor = Event.None + onDidActiveEditorChange = Event.None + onDidVisibleEditorsChange = Event.None + onDidEditorsChange = Event.None + onDidCloseEditor = Event.None + activeEditorPane = undefined + activeEditor = undefined + get activeTextEditorControl() { + return StandaloneServices.get(ICodeEditorService).getFocusedCodeEditor() ?? undefined + } -registerSingleton(IPaneCompositePartService, class PaneCompositePartService implements IPaneCompositePartService { - readonly _serviceBrand = undefined - onDidPaneCompositeOpen = Event.None - onDidPaneCompositeClose = Event.None - openPaneComposite = async () => undefined - getActivePaneComposite = () => undefined - getPaneComposite = () => undefined - getPaneComposites = () => [] - getPinnedPaneCompositeIds = () => [] - getVisiblePaneCompositeIds = () => [] - getProgressIndicator = () => undefined - hideActivePaneComposite = () => {} - getLastActivePaneCompositeId = unsupported - showActivity = () => Disposable.None -}, InstantiationType.Eager) + activeTextEditorLanguageId = undefined + visibleEditorPanes = [] + visibleEditors = [] + visibleTextEditorControls = [] + editors = [] + count = 0 + getEditors = () => [] + openEditor = unsupported + openEditors = unsupported + replaceEditors = async () => {} + isOpened = () => false + isVisible = () => false + closeEditor = async () => {} + closeEditors = async () => {} + findEditors = () => [] + save = async () => ({ success: false, editors: [] }) + saveAll = async () => ({ success: false, editors: [] }) + revert = async () => false + revertAll = async () => false + createScoped(): IEditorService { + return this + } + }, + InstantiationType.Eager +) + +registerSingleton( + IPaneCompositePartService, + class PaneCompositePartService implements IPaneCompositePartService { + readonly _serviceBrand = undefined + onDidPaneCompositeOpen = Event.None + onDidPaneCompositeClose = Event.None + openPaneComposite = async () => undefined + getActivePaneComposite = () => undefined + getPaneComposite = () => undefined + getPaneComposites = () => [] + getPinnedPaneCompositeIds = () => [] + getVisiblePaneCompositeIds = () => [] + getProgressIndicator = () => undefined + hideActivePaneComposite = () => {} + getLastActivePaneCompositeId = unsupported + showActivity = () => Disposable.None + }, + InstantiationType.Eager +) registerSingleton(IUriIdentityService, UriIdentityService, InstantiationType.Delayed) -registerSingleton(ITextFileService, class TextFileService implements ITextFileService { - _serviceBrand: undefined - get files () { - return unsupported() - } - - get untitled () { - return unsupported() - } +registerSingleton( + ITextFileService, + class TextFileService implements ITextFileService { + _serviceBrand: undefined + get files() { + return unsupported() + } - get encoding () { - return unsupported() - } + get untitled() { + return unsupported() + } - isDirty = unsupported - save = unsupported - saveAs = unsupported - revert = unsupported - read = unsupported - readStream = unsupported - write = unsupported - create = unsupported - getEncodedReadable = unsupported - getDecodedStream = unsupported - dispose = unsupported -}, InstantiationType.Eager) + get encoding() { + return unsupported() + } -registerSingleton(IFileService, class FileService implements IFileService { - readonly _serviceBrand = undefined - onDidChangeFileSystemProviderRegistrations = Event.None - onDidChangeFileSystemProviderCapabilities = Event.None - onWillActivateFileSystemProvider = Event.None - registerProvider = unsupported - getProvider = function () { - return undefined - } + isDirty = unsupported + save = unsupported + saveAs = unsupported + revert = unsupported + read = unsupported + readStream = unsupported + write = unsupported + create = unsupported + getEncodedReadable = unsupported + getDecodedStream = unsupported + dispose = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IFileService, + class FileService implements IFileService { + readonly _serviceBrand = undefined + onDidChangeFileSystemProviderRegistrations = Event.None + onDidChangeFileSystemProviderCapabilities = Event.None + onWillActivateFileSystemProvider = Event.None + registerProvider = unsupported + getProvider = function () { + return undefined + } - activateProvider = async () => {} - canHandleResource = async () => false - hasProvider = () => false - hasCapability = () => false - listCapabilities = () => [] - onDidFilesChange = Event.None - onDidRunOperation = Event.None - resolve = unsupported - resolveAll = unsupported - stat = unsupported - exists = async () => false - readFile = unsupported - readFileStream = unsupported - writeFile = unsupported - move = unsupported - canMove = unsupported - copy = unsupported - canCopy = unsupported - cloneFile = unsupported - createFile = unsupported - canCreateFile = unsupported - createFolder = unsupported - del = unsupported - canDelete = unsupported - onDidWatchError = Event.None - watch = unsupported - createWatcher = unsupported - dispose () { - // ignore - } -}, InstantiationType.Eager) + activateProvider = async () => {} + canHandleResource = async () => false + hasProvider = () => false + hasCapability = () => false + listCapabilities = () => [] + onDidFilesChange = Event.None + onDidRunOperation = Event.None + resolve = unsupported + resolveAll = unsupported + stat = unsupported + exists = async () => false + readFile = unsupported + readFileStream = unsupported + writeFile = unsupported + move = unsupported + canMove = unsupported + copy = unsupported + canCopy = unsupported + cloneFile = unsupported + createFile = unsupported + canCreateFile = unsupported + createFolder = unsupported + del = unsupported + canDelete = unsupported + onDidWatchError = Event.None + watch = unsupported + createWatcher = unsupported + dispose() { + // ignore + } + }, + InstantiationType.Eager +) class EmptyEditorGroup implements IEditorGroup, IEditorGroupView { selectedEditors = [] @@ -370,16 +480,16 @@ class EmptyEditorGroup implements IEditorGroup, IEditorGroupView { setSelection = unsupported isTransient = () => false windowId = mainWindow.vscodeWindowId - get groupsView () { + get groupsView() { return unsupported() } - notifyLabelChanged (): void {} + notifyLabelChanged(): void {} createEditorActions = unsupported onDidFocus = Event.None onDidOpenEditorFail = Event.None whenRestored = Promise.resolve() - get titleHeight () { + get titleHeight() { return unsupported() } @@ -391,7 +501,7 @@ class EmptyEditorGroup implements IEditorGroup, IEditorGroupView { toJSON = unsupported preferredWidth?: number | undefined preferredHeight?: number | undefined - get element () { + get element() { return unsupported() } @@ -420,7 +530,10 @@ class EmptyEditorGroup implements IEditorGroup, IEditorGroupView { isLocked = false stickyCount = 0 editors = [] - get scopedContextKeyService (): IContextKeyService { return StandaloneServices.get(IContextKeyService) } + get scopedContextKeyService(): IContextKeyService { + return StandaloneServices.get(IContextKeyService) + } + getEditors = () => [] findEditors = () => [] getEditorByIndex = () => undefined @@ -443,7 +556,7 @@ class EmptyEditorGroup implements IEditorGroup, IEditorGroupView { stickEditor = () => {} unstickEditor = () => {} lock = () => {} - focus (): void { + focus(): void { // ignore } @@ -459,7 +572,10 @@ class EmptyEditorPart implements IEditorPart { hasMaximizedGroup = () => false onDidLayout = Event.None onDidScroll = Event.None - get contentDimension (): never { return unsupported() } + get contentDimension(): never { + return unsupported() + } + isReady = true whenReady = Promise.resolve() whenRestored = Promise.resolve() @@ -476,7 +592,10 @@ class EmptyEditorPart implements IEditorPart { onDidChangeGroupLocked = Event.None onDidChangeGroupMaximized = Event.None activeGroup = fakeActiveGroup - get sideGroup (): never { return unsupported() } + get sideGroup(): never { + return unsupported() + } + groups = [fakeActiveGroup] count = 0 orientation = GroupOrientation.HORIZONTAL @@ -535,9 +654,15 @@ class EmptyEditorGroupsService implements IEditorGroupsService { onDidScroll = Event.None onDidChangeGroupIndex = Event.None onDidChangeGroupLocked = Event.None - get contentDimension (): never { return unsupported() } + get contentDimension(): never { + return unsupported() + } + activeGroup = fakeActiveGroup - get sideGroup (): never { return unsupported() } + get sideGroup(): never { + return unsupported() + } + groups = [fakeActiveGroup] count = 0 orientation = GroupOrientation.HORIZONTAL @@ -568,168 +693,223 @@ class EmptyEditorGroupsService implements IEditorGroupsService { registerSingleton(IEditorGroupsService, EmptyEditorGroupsService, InstantiationType.Eager) -registerSingleton(IBannerService, class BannerService implements IBannerService { - _serviceBrand: undefined - focus (): void {} - focusNextAction (): void {} - focusPreviousAction (): void {} - hide (): void {} - show (): void {} -}, InstantiationType.Eager) - -registerSingleton(ITitleService, class TitleService implements ITitleService { - _serviceBrand: undefined - getPart = unsupported - createAuxiliaryTitlebarPart = unsupported - dispose = unsupported - onMenubarVisibilityChange = Event.None - isCommandCenterVisible = false - onDidChangeCommandCenterVisibility = Event.None - updateProperties (): void {} - registerVariables = () => {} -}, InstantiationType.Eager) - -registerSingleton(IWorkingCopyFileService, class WorkingCopyFileService implements IWorkingCopyFileService { - _serviceBrand: undefined - onWillRunWorkingCopyFileOperation = Event.None - onDidFailWorkingCopyFileOperation = Event.None - onDidRunWorkingCopyFileOperation = Event.None - addFileOperationParticipant = unsupported - - hasSaveParticipants = false - - addSaveParticipant = unsupported - - runSaveParticipants = unsupported - - create = unsupported - - createFolder = unsupported - - move = unsupported - - copy = unsupported - - delete = unsupported - - registerWorkingCopyProvider = unsupported - - getDirty = () => [] -}, InstantiationType.Eager) - -registerSingleton(IPathService, class PathService implements IPathService { - _serviceBrand: undefined - get path () { - return unsupported() - } - - defaultUriScheme = 'file' - fileURI = unsupported - userHome = unsupported - hasValidBasename = unsupported - resolvedUserHome = undefined -}, InstantiationType.Delayed) - -registerSingleton(IProductService, class ProductService implements IProductService { - readonly _serviceBrand = undefined - - version = VSCODE_VERSION - commit = VSCODE_COMMIT - quality = 'oss' - nameShort = 'Code - OSS Dev' - nameLong = 'Code - OSS Dev' - applicationName = 'code-oss' - dataFolderName = '.vscode-oss' - urlProtocol = 'code-oss' - reportIssueUrl = 'https://github.com/microsoft/vscode/issues/new' - licenseName = 'MIT' - licenseUrl = 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt' - serverApplicationName = 'code-server-oss' -}, InstantiationType.Eager) - -registerSingleton(IExtensionTipsService, class ExtensionTipsService implements IExtensionTipsService { - readonly _serviceBrand = undefined - getConfigBasedTips = async () => [] - getImportantExecutableBasedTips = async () => [] - getOtherExecutableBasedTips = async () => [] -}, InstantiationType.Eager) - -registerSingleton(ILanguageStatusService, class LanguageStatusService implements ILanguageStatusService { - _serviceBrand: undefined - onDidChange = Event.None - addStatus = unsupported - getLanguageStatus = unsupported -}, InstantiationType.Delayed) +registerSingleton( + IBannerService, + class BannerService implements IBannerService { + _serviceBrand: undefined + focus(): void {} + focusNextAction(): void {} + focusPreviousAction(): void {} + hide(): void {} + show(): void {} + }, + InstantiationType.Eager +) + +registerSingleton( + ITitleService, + class TitleService implements ITitleService { + _serviceBrand: undefined + getPart = unsupported + createAuxiliaryTitlebarPart = unsupported + dispose = unsupported + onMenubarVisibilityChange = Event.None + isCommandCenterVisible = false + onDidChangeCommandCenterVisibility = Event.None + updateProperties(): void {} + registerVariables = () => {} + }, + InstantiationType.Eager +) + +registerSingleton( + IWorkingCopyFileService, + class WorkingCopyFileService implements IWorkingCopyFileService { + _serviceBrand: undefined + onWillRunWorkingCopyFileOperation = Event.None + onDidFailWorkingCopyFileOperation = Event.None + onDidRunWorkingCopyFileOperation = Event.None + addFileOperationParticipant = unsupported + + hasSaveParticipants = false + + addSaveParticipant = unsupported + + runSaveParticipants = unsupported + + create = unsupported + + createFolder = unsupported + + move = unsupported + + copy = unsupported + + delete = unsupported + + registerWorkingCopyProvider = unsupported + + getDirty = () => [] + }, + InstantiationType.Eager +) + +registerSingleton( + IPathService, + class PathService implements IPathService { + _serviceBrand: undefined + get path() { + return unsupported() + } -registerSingleton(IHostService, class HostService implements IHostService { - _serviceBrand: undefined - getPathForFile = () => undefined - onDidChangeFullScreen = Event.None - onDidChangeFocus = Event.None - hasFocus = false - hadLastFocus = async () => false - focus = unsupported - onDidChangeActiveWindow = Event.None - openWindow = unsupported - toggleFullScreen = unsupported - moveTop = unsupported - getCursorScreenPoint = unsupported - restart = unsupported - reload = unsupported - close = unsupported - withExpectedShutdown = unsupported -}, InstantiationType.Eager) - -registerSingleton(ILifecycleService, class LifecycleService extends AbstractLifecycleService { - shutdown = unsupported -}, InstantiationType.Eager) - -registerSingleton(ILanguageDetectionService, class LanguageDetectionService implements ILanguageDetectionService { - _serviceBrand: undefined - isEnabledForLanguage (): boolean { - return false - } + defaultUriScheme = 'file' + fileURI = unsupported + userHome = unsupported + hasValidBasename = unsupported + resolvedUserHome = undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + IProductService, + class ProductService implements IProductService { + readonly _serviceBrand = undefined + + version = VSCODE_VERSION + commit = VSCODE_COMMIT + quality = 'oss' + nameShort = 'Code - OSS Dev' + nameLong = 'Code - OSS Dev' + applicationName = 'code-oss' + dataFolderName = '.vscode-oss' + urlProtocol = 'code-oss' + reportIssueUrl = 'https://github.com/microsoft/vscode/issues/new' + licenseName = 'MIT' + licenseUrl = 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt' + serverApplicationName = 'code-server-oss' + }, + InstantiationType.Eager +) + +registerSingleton( + IExtensionTipsService, + class ExtensionTipsService implements IExtensionTipsService { + readonly _serviceBrand = undefined + getConfigBasedTips = async () => [] + getImportantExecutableBasedTips = async () => [] + getOtherExecutableBasedTips = async () => [] + }, + InstantiationType.Eager +) + +registerSingleton( + ILanguageStatusService, + class LanguageStatusService implements ILanguageStatusService { + _serviceBrand: undefined + onDidChange = Event.None + addStatus = unsupported + getLanguageStatus = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IHostService, + class HostService implements IHostService { + _serviceBrand: undefined + getPathForFile = () => undefined + onDidChangeFullScreen = Event.None + onDidChangeFocus = Event.None + hasFocus = false + hadLastFocus = async () => false + focus = unsupported + onDidChangeActiveWindow = Event.None + openWindow = unsupported + toggleFullScreen = unsupported + moveTop = unsupported + getCursorScreenPoint = unsupported + restart = unsupported + reload = unsupported + close = unsupported + withExpectedShutdown = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + ILifecycleService, + class LifecycleService extends AbstractLifecycleService { + shutdown = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + ILanguageDetectionService, + class LanguageDetectionService implements ILanguageDetectionService { + _serviceBrand: undefined + isEnabledForLanguage(): boolean { + return false + } - async detectLanguage (): Promise { - return undefined - } -}, InstantiationType.Eager) + async detectLanguage(): Promise { + return undefined + } + }, + InstantiationType.Eager +) registerSingleton(IExtensionService, NullExtensionService, InstantiationType.Eager) -registerSingleton(IKeyboardLayoutService, class KeyboardLayoutService implements IKeyboardLayoutService { - _serviceBrand: undefined - onDidChangeKeyboardLayout = Event.None - getRawKeyboardMapping = () => null - getCurrentKeyboardLayout = () => null - getAllKeyboardLayouts = () => [] - getKeyboardMapper = () => new FallbackKeyboardMapper(false, OS) - validateCurrentKeyboardMapping = () => {} -}, InstantiationType.Delayed) - -registerSingleton(IUserDataInitializationService, class NullUserDataInitializationService implements IUserDataInitializationService { - _serviceBrand: undefined - async requiresInitialization (): Promise { - return false - } - - async whenInitializationFinished (): Promise {} - async initializeRequiredResources (): Promise {} - async initializeInstalledExtensions (): Promise {} - async initializeOtherResources (): Promise {} -}, InstantiationType.Eager) +registerSingleton( + IKeyboardLayoutService, + class KeyboardLayoutService implements IKeyboardLayoutService { + _serviceBrand: undefined + onDidChangeKeyboardLayout = Event.None + getRawKeyboardMapping = () => null + getCurrentKeyboardLayout = () => null + getAllKeyboardLayouts = () => [] + getKeyboardMapper = () => new FallbackKeyboardMapper(false, OS) + validateCurrentKeyboardMapping = () => {} + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataInitializationService, + class NullUserDataInitializationService implements IUserDataInitializationService { + _serviceBrand: undefined + async requiresInitialization(): Promise { + return false + } -registerSingleton(IHostColorSchemeService, class HostColorSchemeService implements IHostColorSchemeService { - _serviceBrand: undefined - dark = false - highContrast = false - onDidChangeColorScheme = Event.None -}, InstantiationType.Eager) + async whenInitializationFinished(): Promise {} + async initializeRequiredResources(): Promise {} + async initializeInstalledExtensions(): Promise {} + async initializeOtherResources(): Promise {} + }, + InstantiationType.Eager +) + +registerSingleton( + IHostColorSchemeService, + class HostColorSchemeService implements IHostColorSchemeService { + _serviceBrand: undefined + dark = false + highContrast = false + onDidChangeColorScheme = Event.None + }, + InstantiationType.Eager +) class PreferencesService implements IPreferencesService { _serviceBrand: undefined - constructor (@IUserDataProfileService protected readonly profileService: IUserDataProfileService) {} + constructor( + @IUserDataProfileService protected readonly profileService: IUserDataProfileService + ) {} + onDidDefaultSettingsContentChanged = Event.None getDefaultSettingsContent = () => undefined @@ -758,16 +938,22 @@ class PreferencesService implements IPreferencesService { registerSingleton(IPreferencesService, PreferencesService, InstantiationType.Eager) -registerSingleton(ITextMateTokenizationService, class NullTextMateService implements ITextMateTokenizationService { - _serviceBrand: undefined - onDidEncounterLanguage = Event.None - createGrammar = unsupported - startDebugMode = unsupported - createTokenizer = unsupported -}, InstantiationType.Eager) +registerSingleton( + ITextMateTokenizationService, + class NullTextMateService implements ITextMateTokenizationService { + _serviceBrand: undefined + onDidEncounterLanguage = Event.None + createGrammar = unsupported + startDebugMode = unsupported + createTokenizer = unsupported + }, + InstantiationType.Eager +) class UserDataProfilesService implements IUserDataProfilesService { - constructor (@IUserDataProfileService protected readonly profileService: IUserDataProfileService) {} + constructor( + @IUserDataProfileService protected readonly profileService: IUserDataProfileService + ) {} _serviceBrand: undefined onDidResetWorkspaces = Event.None @@ -777,7 +963,10 @@ class UserDataProfilesService implements IUserDataProfilesService { resetWorkspaces = unsupported cleanUp = unsupported cleanUpTransientProfiles = unsupported - get profilesHome () { return unsupported() } + get profilesHome() { + return unsupported() + } + defaultProfile = this.profileService.currentProfile onDidChangeProfiles = Event.None profiles = [this.profileService.currentProfile] @@ -790,16 +979,20 @@ class UserDataProfilesService implements IUserDataProfilesService { registerSingleton(IUserDataProfilesService, UserDataProfilesService, InstantiationType.Eager) -registerSingleton(IUserDataProfileStorageService, class UserDataProfileStorageService implements IUserDataProfileStorageService { - _serviceBrand: undefined - onDidChange = Event.None - readStorageData = unsupported - updateStorageData = unsupported - withProfileScopedStorageService = unsupported -}, InstantiationType.Eager) +registerSingleton( + IUserDataProfileStorageService, + class UserDataProfileStorageService implements IUserDataProfileStorageService { + _serviceBrand: undefined + onDidChange = Event.None + readStorageData = unsupported + updateStorageData = unsupported + withProfileScopedStorageService = unsupported + }, + InstantiationType.Eager +) class InjectedUserDataProfileService extends UserDataProfileService { - constructor (@IEnvironmentService environmentService: IEnvironmentService) { + constructor(@IEnvironmentService environmentService: IEnvironmentService) { super({ ...toUserDataProfile( '__default__profile__', @@ -815,15 +1008,19 @@ registerSingleton(IUserDataProfileService, InjectedUserDataProfileService, Insta registerSingleton(IPolicyService, NullPolicyService, InstantiationType.Eager) -registerSingleton(ISnippetsService, class SnippetsService implements ISnippetsService { - _serviceBrand: undefined - getSnippetFiles = unsupported - isEnabled = unsupported - updateEnablement = unsupported - updateUsageTimestamp = unsupported - getSnippets = async () => [] - getSnippetsSync = unsupported -}, InstantiationType.Eager) +registerSingleton( + ISnippetsService, + class SnippetsService implements ISnippetsService { + _serviceBrand: undefined + getSnippetFiles = unsupported + isEnabled = unsupported + updateEnablement = unsupported + updateUsageTimestamp = unsupported + getSnippets = async () => [] + getSnippetsSync = unsupported + }, + InstantiationType.Eager +) const debugModel: IDebugModel = { getSession: () => undefined, @@ -885,2540 +1082,3354 @@ class FakeAdapterManager implements IAdapterManager { guessDebugger = unsupported onDidDebuggersExtPointRead = Event.None } -registerSingleton(IDebugService, class DebugService implements IDebugService { - _serviceBrand: undefined - initializingOptions = undefined - sendBreakpoints = unsupported - updateDataBreakpoint = unsupported - get state () { return unsupported() } - onDidChangeState = Event.None - onDidNewSession = Event.None - onWillNewSession = Event.None - onDidEndSession = Event.None - getConfigurationManager = unsupported - getAdapterManager = () => new FakeAdapterManager() - focusStackFrame = unsupported - canSetBreakpointsIn = unsupported - addBreakpoints = unsupported - updateBreakpoints = unsupported - enableOrDisableBreakpoints = unsupported - setBreakpointsActivated = unsupported - removeBreakpoints = unsupported - addFunctionBreakpoint = unsupported - updateFunctionBreakpoint = unsupported - removeFunctionBreakpoints = unsupported - addDataBreakpoint = unsupported - removeDataBreakpoints = unsupported - addInstructionBreakpoint = unsupported - removeInstructionBreakpoints = unsupported - setExceptionBreakpointCondition = unsupported - setExceptionBreakpointsForSession = unsupported - sendAllBreakpoints = unsupported - addWatchExpression = unsupported - renameWatchExpression = unsupported - moveWatchExpression = unsupported - removeWatchExpressions = unsupported - startDebugging = unsupported - restartSession = unsupported - stopSession = unsupported - sourceIsNotAvailable = unsupported - getModel = () => debugModel - getViewModel = () => new FakeViewModel() - runTo = unsupported -}, InstantiationType.Eager) - -registerSingleton(IRequestService, class RequestService implements IRequestService { - _serviceBrand: undefined - lookupAuthorization = unsupported - lookupKerberosAuthorization = unsupported - request = unsupported - resolveProxy = unsupported - loadCertificates = unsupported -}, InstantiationType.Eager) - -registerSingleton(IWorkspaceTrustRequestService, class WorkspaceTrustRequestService implements IWorkspaceTrustRequestService { - _serviceBrand: undefined - onDidInitiateOpenFilesTrustRequest = Event.None - onDidInitiateWorkspaceTrustRequest = Event.None - onDidInitiateWorkspaceTrustRequestOnStartup = Event.None - completeOpenFilesTrustRequest = unsupported - requestOpenFilesTrust = async () => WorkspaceTrustUriResponse.Open - cancelWorkspaceTrustRequest = unsupported - completeWorkspaceTrustRequest = unsupported - requestWorkspaceTrust = async () => true - requestWorkspaceTrustOnStartup = () => null -}, InstantiationType.Eager) - -registerSingleton(IActivityService, class ActivityService implements IActivityService { - _serviceBrand: undefined - onDidChangeActivity = Event.None - getViewContainerActivities = unsupported - getActivity = unsupported - showViewContainerActivity = () => Disposable.None - showViewActivity = () => Disposable.None - showAccountsActivity = () => Disposable.None - showGlobalActivity = () => Disposable.None -}, InstantiationType.Eager) - -registerSingleton(IExtensionHostDebugService, class ExtensionHostDebugService implements IExtensionHostDebugService { - _serviceBrand: undefined - reload = unsupported - onReload = Event.None - close = unsupported - onClose = Event.None - attachSession = unsupported - onAttachSession = Event.None - terminateSession = unsupported - onTerminateSession = Event.None - openExtensionDevelopmentHostWindow = unsupported -}, InstantiationType.Eager) - -registerSingleton(IViewsService, class ViewsService implements IViewsService { - _serviceBrand: undefined - isViewContainerActive = () => false - getFocusedViewName = unsupported - onDidChangeFocusedView = Event.None - onDidChangeViewContainerVisibility = Event.None - isViewContainerVisible = () => false - openViewContainer = unsupported - closeViewContainer = unsupported - getVisibleViewContainer = unsupported - getActiveViewPaneContainerWithId = () => null - onDidChangeViewVisibility = Event.None - isViewVisible = () => false - openView = async () => null - closeView = unsupported - getActiveViewWithId = () => null - getViewWithId = () => null - getViewProgressIndicator = () => undefined -}, InstantiationType.Eager) - -registerSingleton(IViewDescriptorService, class ViewDescriptorService implements IViewDescriptorService { - _serviceBrand: undefined - viewContainers = [] - onDidChangeViewContainers = Event.None - getDefaultViewContainer = () => undefined - getViewContainerById = () => null - isViewContainerRemovedPermanently = unsupported - getDefaultViewContainerLocation = () => null - getViewContainerLocation = () => null - getViewContainersByLocation = unsupported - getViewContainerModel = () => ({ - onDidChangeAllViewDescriptors: Event.None, - visibleViewDescriptors: [] - } as Pick as IViewContainerModel) - - onDidChangeContainerLocation = Event.None - moveViewContainerToLocation = unsupported - getViewContainerBadgeEnablementState = unsupported - setViewContainerBadgeEnablementState = unsupported - getViewDescriptorById = () => null - getViewContainerByViewId = () => null - getDefaultContainerById = () => null - getViewLocationById = () => null - onDidChangeContainer = Event.None - moveViewsToContainer = unsupported - onDidChangeLocation = Event.None - moveViewToLocation = () => null - reset = () => null -}, InstantiationType.Eager) - -registerSingleton(IHistoryService, class HistoryService implements IHistoryService { - _serviceBrand: undefined - suspendTracking = () => ({ - dispose () { - } - }) - - goForward = unsupported - goBack = unsupported - goPrevious = unsupported - goLast = unsupported - reopenLastClosedEditor = unsupported - getHistory = () => [] - removeFromHistory = unsupported - getLastActiveWorkspaceRoot = () => undefined - getLastActiveFile = () => undefined - openNextRecentlyUsedEditor = unsupported - openPreviouslyUsedEditor = unsupported - clear = unsupported - clearRecentlyOpened = unsupported -}, InstantiationType.Eager) - -registerSingleton(ITaskService, class TaskService implements ITaskService { - onDidChangeTaskProviders = Event.None - getKnownTasks = async () => [] - _serviceBrand: undefined - onDidChangeTaskConfig = Event.None - onDidStateChange = Event.None - supportsMultipleTaskExecutions = false - configureAction = unsupported - run = unsupported - inTerminal = () => false - getActiveTasks = async () => [] - getBusyTasks = unsupported - terminate = unsupported - tasks = unsupported - taskTypes = unsupported - getWorkspaceTasks = unsupported - getSavedTasks = unsupported - removeRecentlyUsedTask = unsupported - getTask = unsupported - tryResolveTask = unsupported - createSorter = unsupported - getTaskDescription = unsupported - customize = unsupported - openConfig = unsupported - registerTaskProvider = unsupported - registerTaskSystem = () => {} - onDidChangeTaskSystemInfo = Event.None - hasTaskSystemInfo = false - registerSupportedExecutions = () => {} - extensionCallbackTaskComplete = unsupported - isReconnected = false - onDidReconnectToTasks = Event.None -}, InstantiationType.Eager) - -registerSingleton(IConfigurationResolverService, class ConfigurationResolverService implements IConfigurationResolverService { - _serviceBrand: undefined - resolveWithEnvironment = unsupported - resolveAsync = unsupported - resolveAnyAsync = unsupported - resolveAnyMap = unsupported - resolveWithInteractionReplace = unsupported - resolveWithInteraction = unsupported - contributeVariable = unsupported -}, InstantiationType.Eager) - -registerSingleton(IRemoteAgentService, class RemoteAgentService implements IRemoteAgentService { - _serviceBrand: undefined - endConnection = unsupported - getConnection = () => null - getEnvironment = async () => null - getRawEnvironment = async () => null - getExtensionHostExitInfo = async () => null - getRoundTripTime = async () => undefined - whenExtensionsReady = async () => undefined - scanExtensions = async () => [] - scanSingleExtension = async () => null - getDiagnosticInfo = async () => undefined - updateTelemetryLevel = async () => undefined - logTelemetry = async () => undefined - flushTelemetry = async () => undefined -}, InstantiationType.Eager) - -registerSingleton(ICustomEndpointTelemetryService, NullEndpointTelemetryService, InstantiationType.Eager) +registerSingleton( + IDebugService, + class DebugService implements IDebugService { + _serviceBrand: undefined + initializingOptions = undefined + sendBreakpoints = unsupported + updateDataBreakpoint = unsupported + get state() { + return unsupported() + } + + onDidChangeState = Event.None + onDidNewSession = Event.None + onWillNewSession = Event.None + onDidEndSession = Event.None + getConfigurationManager = unsupported + getAdapterManager = () => new FakeAdapterManager() + focusStackFrame = unsupported + canSetBreakpointsIn = unsupported + addBreakpoints = unsupported + updateBreakpoints = unsupported + enableOrDisableBreakpoints = unsupported + setBreakpointsActivated = unsupported + removeBreakpoints = unsupported + addFunctionBreakpoint = unsupported + updateFunctionBreakpoint = unsupported + removeFunctionBreakpoints = unsupported + addDataBreakpoint = unsupported + removeDataBreakpoints = unsupported + addInstructionBreakpoint = unsupported + removeInstructionBreakpoints = unsupported + setExceptionBreakpointCondition = unsupported + setExceptionBreakpointsForSession = unsupported + sendAllBreakpoints = unsupported + addWatchExpression = unsupported + renameWatchExpression = unsupported + moveWatchExpression = unsupported + removeWatchExpressions = unsupported + startDebugging = unsupported + restartSession = unsupported + stopSession = unsupported + sourceIsNotAvailable = unsupported + getModel = () => debugModel + getViewModel = () => new FakeViewModel() + runTo = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IRequestService, + class RequestService implements IRequestService { + _serviceBrand: undefined + lookupAuthorization = unsupported + lookupKerberosAuthorization = unsupported + request = unsupported + resolveProxy = unsupported + loadCertificates = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IWorkspaceTrustRequestService, + class WorkspaceTrustRequestService implements IWorkspaceTrustRequestService { + _serviceBrand: undefined + onDidInitiateOpenFilesTrustRequest = Event.None + onDidInitiateWorkspaceTrustRequest = Event.None + onDidInitiateWorkspaceTrustRequestOnStartup = Event.None + completeOpenFilesTrustRequest = unsupported + requestOpenFilesTrust = async () => WorkspaceTrustUriResponse.Open + cancelWorkspaceTrustRequest = unsupported + completeWorkspaceTrustRequest = unsupported + requestWorkspaceTrust = async () => true + requestWorkspaceTrustOnStartup = () => null + }, + InstantiationType.Eager +) + +registerSingleton( + IActivityService, + class ActivityService implements IActivityService { + _serviceBrand: undefined + onDidChangeActivity = Event.None + getViewContainerActivities = unsupported + getActivity = unsupported + showViewContainerActivity = () => Disposable.None + showViewActivity = () => Disposable.None + showAccountsActivity = () => Disposable.None + showGlobalActivity = () => Disposable.None + }, + InstantiationType.Eager +) + +registerSingleton( + IExtensionHostDebugService, + class ExtensionHostDebugService implements IExtensionHostDebugService { + _serviceBrand: undefined + reload = unsupported + onReload = Event.None + close = unsupported + onClose = Event.None + attachSession = unsupported + onAttachSession = Event.None + terminateSession = unsupported + onTerminateSession = Event.None + openExtensionDevelopmentHostWindow = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IViewsService, + class ViewsService implements IViewsService { + _serviceBrand: undefined + isViewContainerActive = () => false + getFocusedViewName = unsupported + onDidChangeFocusedView = Event.None + onDidChangeViewContainerVisibility = Event.None + isViewContainerVisible = () => false + openViewContainer = unsupported + closeViewContainer = unsupported + getVisibleViewContainer = unsupported + getActiveViewPaneContainerWithId = () => null + onDidChangeViewVisibility = Event.None + isViewVisible = () => false + openView = async () => null + closeView = unsupported + getActiveViewWithId = () => null + getViewWithId = () => null + getViewProgressIndicator = () => undefined + }, + InstantiationType.Eager +) + +registerSingleton( + IViewDescriptorService, + class ViewDescriptorService implements IViewDescriptorService { + _serviceBrand: undefined + viewContainers = [] + onDidChangeViewContainers = Event.None + getDefaultViewContainer = () => undefined + getViewContainerById = () => null + isViewContainerRemovedPermanently = unsupported + getDefaultViewContainerLocation = () => null + getViewContainerLocation = () => null + getViewContainersByLocation = unsupported + getViewContainerModel = () => + ({ + onDidChangeAllViewDescriptors: Event.None, + visibleViewDescriptors: [] + }) as Pick< + IViewContainerModel, + 'onDidChangeAllViewDescriptors' | 'visibleViewDescriptors' + > as IViewContainerModel + + onDidChangeContainerLocation = Event.None + moveViewContainerToLocation = unsupported + getViewContainerBadgeEnablementState = unsupported + setViewContainerBadgeEnablementState = unsupported + getViewDescriptorById = () => null + getViewContainerByViewId = () => null + getDefaultContainerById = () => null + getViewLocationById = () => null + onDidChangeContainer = Event.None + moveViewsToContainer = unsupported + onDidChangeLocation = Event.None + moveViewToLocation = () => null + reset = () => null + }, + InstantiationType.Eager +) + +registerSingleton( + IHistoryService, + class HistoryService implements IHistoryService { + _serviceBrand: undefined + suspendTracking = () => ({ + dispose() {} + }) + + goForward = unsupported + goBack = unsupported + goPrevious = unsupported + goLast = unsupported + reopenLastClosedEditor = unsupported + getHistory = () => [] + removeFromHistory = unsupported + getLastActiveWorkspaceRoot = () => undefined + getLastActiveFile = () => undefined + openNextRecentlyUsedEditor = unsupported + openPreviouslyUsedEditor = unsupported + clear = unsupported + clearRecentlyOpened = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + ITaskService, + class TaskService implements ITaskService { + onDidChangeTaskProviders = Event.None + getKnownTasks = async () => [] + _serviceBrand: undefined + onDidChangeTaskConfig = Event.None + onDidStateChange = Event.None + supportsMultipleTaskExecutions = false + configureAction = unsupported + run = unsupported + inTerminal = () => false + getActiveTasks = async () => [] + getBusyTasks = unsupported + terminate = unsupported + tasks = unsupported + taskTypes = unsupported + getWorkspaceTasks = unsupported + getSavedTasks = unsupported + removeRecentlyUsedTask = unsupported + getTask = unsupported + tryResolveTask = unsupported + createSorter = unsupported + getTaskDescription = unsupported + customize = unsupported + openConfig = unsupported + registerTaskProvider = unsupported + registerTaskSystem = () => {} + onDidChangeTaskSystemInfo = Event.None + hasTaskSystemInfo = false + registerSupportedExecutions = () => {} + extensionCallbackTaskComplete = unsupported + isReconnected = false + onDidReconnectToTasks = Event.None + }, + InstantiationType.Eager +) + +registerSingleton( + IConfigurationResolverService, + class ConfigurationResolverService implements IConfigurationResolverService { + _serviceBrand: undefined + resolveWithEnvironment = unsupported + resolveAsync = unsupported + resolveAnyAsync = unsupported + resolveAnyMap = unsupported + resolveWithInteractionReplace = unsupported + resolveWithInteraction = unsupported + contributeVariable = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IRemoteAgentService, + class RemoteAgentService implements IRemoteAgentService { + _serviceBrand: undefined + endConnection = unsupported + getConnection = () => null + getEnvironment = async () => null + getRawEnvironment = async () => null + getExtensionHostExitInfo = async () => null + getRoundTripTime = async () => undefined + whenExtensionsReady = async () => undefined + scanExtensions = async () => [] + scanSingleExtension = async () => null + getDiagnosticInfo = async () => undefined + updateTelemetryLevel = async () => undefined + logTelemetry = async () => undefined + flushTelemetry = async () => undefined + }, + InstantiationType.Eager +) + +registerSingleton( + ICustomEndpointTelemetryService, + NullEndpointTelemetryService, + InstantiationType.Eager +) class MonacoSearchService implements ISearchService { _serviceBrand: undefined - constructor (@IModelService private modelService: IModelService) {} + constructor(@IModelService private modelService: IModelService) {} getAIName = async () => undefined aiTextSearch = unsupported textSearchSplitSyncAsync = unsupported - async textSearch (): Promise { + async textSearch(): Promise { return { results: [], messages: [] } } - async fileSearch (): Promise { + async fileSearch(): Promise { return { - results: this.modelService.getModels().map(model => ({ + results: this.modelService.getModels().map((model) => ({ resource: model.uri })), messages: [] } } - async clearCache (): Promise { - } + async clearCache(): Promise {} registerSearchResultProvider = unsupported } registerSingleton(ISearchService, MonacoSearchService, InstantiationType.Eager) -registerSingleton(IEditSessionIdentityService, class EditSessionIdentityService implements IEditSessionIdentityService { - _serviceBrand: undefined - registerEditSessionIdentityProvider = () => Disposable.None - getEditSessionIdentifier = async () => undefined - provideEditSessionIdentityMatch = async () => undefined - addEditSessionIdentityCreateParticipant = () => Disposable.None - onWillCreateEditSessionIdentity = async () => {} -}, InstantiationType.Eager) - -registerSingleton(IWorkspaceEditingService, class WorkspaceEditingService implements IWorkspaceEditingService { - _serviceBrand: undefined - addFolders = unsupported - removeFolders = unsupported - updateFolders = unsupported - enterWorkspace = unsupported - createAndEnterWorkspace = unsupported - saveAndEnterWorkspace = unsupported - copyWorkspaceSettings = unsupported - pickNewWorkspacePath = unsupported -}, InstantiationType.Eager) - -registerSingleton(ITimerService, class TimerService implements ITimerService { - _serviceBrand: undefined - getStartTime = unsupported - whenReady = unsupported - get perfBaseline () { return unsupported() } - get startupMetrics () { return unsupported() } - setPerformanceMarks = () => {} - getPerformanceMarks = unsupported - getDuration = unsupported -}, InstantiationType.Eager) - -registerSingleton(IExtensionsWorkbenchService, class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { - _serviceBrand: undefined - updateAutoUpdateForAllExtensions = unsupported - openSearch = unsupported - getExtensionRuntimeStatus = () => undefined - onDidChangeExtensionsNotification = Event.None - getExtensionsNotification = () => undefined - shouldRequireConsentToUpdate = async () => undefined - updateAutoUpdateValue = unsupported - getResourceExtensions = unsupported - updateRunningExtensions = unsupported - togglePreRelease = unsupported - isAutoUpdateEnabledFor = unsupported - updateAutoUpdateEnablementFor = unsupported - isAutoUpdateEnabled = unsupported - getAutoUpdateValue = unsupported - updateAll = unsupported - toggleApplyExtensionToAllProfiles = unsupported - whenInitialized = Promise.resolve() - onChange = Event.None - onReset = Event.None - preferPreReleases = false - local = [] - installed = [] - outdated = [] - queryLocal = unsupported - queryGallery = unsupported - getExtensions = unsupported - canInstall = unsupported - install = unsupported - installInServer = unsupported - uninstall = unsupported - installVersion = unsupported - reinstall = unsupported - canSetLanguage = unsupported - setLanguage = unsupported - setEnablement = unsupported - pinExtension = unsupported - open = unsupported - checkForUpdates = unsupported - getExtensionStatus = unsupported - isExtensionIgnoredToSync = unsupported - toggleExtensionIgnoredToSync = unsupported -}, InstantiationType.Eager) - -registerSingleton(IExtensionManagementServerService, class ExtensionManagementServerService implements IExtensionManagementServerService { - _serviceBrand = undefined - localExtensionManagementServer = null - remoteExtensionManagementServer = null - webExtensionManagementServer = null - - getExtensionManagementServer = unsupported - - getExtensionInstallLocation = unsupported -}, InstantiationType.Eager) - -registerSingleton(IExtensionRecommendationsService, class ExtensionRecommendationsService implements IExtensionRecommendationsService { - _serviceBrand: undefined - onDidChangeRecommendations = Event.None - getAllRecommendationsWithReason = () => ({}) - getImportantRecommendations = async () => [] - getOtherRecommendations = async () => [] - getFileBasedRecommendations = () => [] - getExeBasedRecommendations = async () => ({ important: [], others: [] }) - getConfigBasedRecommendations = async () => ({ important: [], others: [] }) - getWorkspaceRecommendations = async () => [] - getKeymapRecommendations = () => [] - getLanguageRecommendations = () => [] - getRemoteRecommendations = () => [] -}, InstantiationType.Eager) -registerSingleton(IUserDataAutoSyncService, class UserDataAutoSyncService implements IUserDataAutoSyncService { - _serviceBrand: undefined - readonly onError = Event.None - turnOn = unsupported - turnOff = unsupported - triggerSync = unsupported -}, InstantiationType.Eager) +registerSingleton( + IEditSessionIdentityService, + class EditSessionIdentityService implements IEditSessionIdentityService { + _serviceBrand: undefined + registerEditSessionIdentityProvider = () => Disposable.None + getEditSessionIdentifier = async () => undefined + provideEditSessionIdentityMatch = async () => undefined + addEditSessionIdentityCreateParticipant = () => Disposable.None + onWillCreateEditSessionIdentity = async () => {} + }, + InstantiationType.Eager +) + +registerSingleton( + IWorkspaceEditingService, + class WorkspaceEditingService implements IWorkspaceEditingService { + _serviceBrand: undefined + addFolders = unsupported + removeFolders = unsupported + updateFolders = unsupported + enterWorkspace = unsupported + createAndEnterWorkspace = unsupported + saveAndEnterWorkspace = unsupported + copyWorkspaceSettings = unsupported + pickNewWorkspacePath = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + ITimerService, + class TimerService implements ITimerService { + _serviceBrand: undefined + getStartTime = unsupported + whenReady = unsupported + get perfBaseline() { + return unsupported() + } -registerSingleton(IIgnoredExtensionsManagementService, class IgnoredExtensionsManagementService implements IIgnoredExtensionsManagementService { - _serviceBrand: undefined - getIgnoredExtensions = () => [] - hasToNeverSyncExtension = () => false - hasToAlwaysSyncExtension = () => false - updateIgnoredExtensions = unsupported - updateSynchronizedExtensions = unsupported -}, InstantiationType.Eager) - -registerSingleton(IExtensionRecommendationNotificationService, class ExtensionRecommendationNotificationService implements IExtensionRecommendationNotificationService { - _serviceBrand: undefined - readonly ignoredRecommendations: string[] = [] - hasToIgnoreRecommendationNotifications = () => false - promptImportantExtensionsInstallNotification = unsupported - promptWorkspaceRecommendations = unsupported -}, InstantiationType.Eager) + get startupMetrics() { + return unsupported() + } -registerSingleton(IWebExtensionsScannerService, class WebExtensionsScannerService implements IWebExtensionsScannerService { - _serviceBrand: undefined - scanSystemExtensions = async () => [] - scanUserExtensions = async () => [] - scanExtensionsUnderDevelopment = async () => [] - scanExistingExtension = async () => null - addExtension = unsupported - addExtensionFromGallery = unsupported - removeExtension = async () => {} - copyExtensions = async () => {} - updateMetadata = unsupported - scanExtensionManifest = async () => null -}, InstantiationType.Eager) - -registerSingleton(IExtensionsScannerService, class ExtensionsScannerService implements IExtensionsScannerService { - _serviceBrand: undefined - get systemExtensionsLocation () { - return unsupported() - } + setPerformanceMarks = () => {} + getPerformanceMarks = unsupported + getDuration = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IExtensionsWorkbenchService, + class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { + _serviceBrand: undefined + updateAutoUpdateForAllExtensions = unsupported + openSearch = unsupported + getExtensionRuntimeStatus = () => undefined + onDidChangeExtensionsNotification = Event.None + getExtensionsNotification = () => undefined + shouldRequireConsentToUpdate = async () => undefined + updateAutoUpdateValue = unsupported + getResourceExtensions = unsupported + updateRunningExtensions = unsupported + togglePreRelease = unsupported + isAutoUpdateEnabledFor = unsupported + updateAutoUpdateEnablementFor = unsupported + isAutoUpdateEnabled = unsupported + getAutoUpdateValue = unsupported + updateAll = unsupported + toggleApplyExtensionToAllProfiles = unsupported + whenInitialized = Promise.resolve() + onChange = Event.None + onReset = Event.None + preferPreReleases = false + local = [] + installed = [] + outdated = [] + queryLocal = unsupported + queryGallery = unsupported + getExtensions = unsupported + canInstall = unsupported + install = unsupported + installInServer = unsupported + uninstall = unsupported + installVersion = unsupported + reinstall = unsupported + canSetLanguage = unsupported + setLanguage = unsupported + setEnablement = unsupported + pinExtension = unsupported + open = unsupported + checkForUpdates = unsupported + getExtensionStatus = unsupported + isExtensionIgnoredToSync = unsupported + toggleExtensionIgnoredToSync = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IExtensionManagementServerService, + class ExtensionManagementServerService implements IExtensionManagementServerService { + _serviceBrand = undefined + localExtensionManagementServer = null + remoteExtensionManagementServer = null + webExtensionManagementServer = null + + getExtensionManagementServer = unsupported + + getExtensionInstallLocation = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IExtensionRecommendationsService, + class ExtensionRecommendationsService implements IExtensionRecommendationsService { + _serviceBrand: undefined + onDidChangeRecommendations = Event.None + getAllRecommendationsWithReason = () => ({}) + getImportantRecommendations = async () => [] + getOtherRecommendations = async () => [] + getFileBasedRecommendations = () => [] + getExeBasedRecommendations = async () => ({ important: [], others: [] }) + getConfigBasedRecommendations = async () => ({ important: [], others: [] }) + getWorkspaceRecommendations = async () => [] + getKeymapRecommendations = () => [] + getLanguageRecommendations = () => [] + getRemoteRecommendations = () => [] + }, + InstantiationType.Eager +) +registerSingleton( + IUserDataAutoSyncService, + class UserDataAutoSyncService implements IUserDataAutoSyncService { + _serviceBrand: undefined + readonly onError = Event.None + turnOn = unsupported + turnOff = unsupported + triggerSync = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IIgnoredExtensionsManagementService, + class IgnoredExtensionsManagementService implements IIgnoredExtensionsManagementService { + _serviceBrand: undefined + getIgnoredExtensions = () => [] + hasToNeverSyncExtension = () => false + hasToAlwaysSyncExtension = () => false + updateIgnoredExtensions = unsupported + updateSynchronizedExtensions = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IExtensionRecommendationNotificationService, + class ExtensionRecommendationNotificationService + implements IExtensionRecommendationNotificationService + { + _serviceBrand: undefined + readonly ignoredRecommendations: string[] = [] + hasToIgnoreRecommendationNotifications = () => false + promptImportantExtensionsInstallNotification = unsupported + promptWorkspaceRecommendations = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IWebExtensionsScannerService, + class WebExtensionsScannerService implements IWebExtensionsScannerService { + _serviceBrand: undefined + scanSystemExtensions = async () => [] + scanUserExtensions = async () => [] + scanExtensionsUnderDevelopment = async () => [] + scanExistingExtension = async () => null + addExtension = unsupported + addExtensionFromGallery = unsupported + removeExtension = async () => {} + copyExtensions = async () => {} + updateMetadata = unsupported + scanExtensionManifest = async () => null + }, + InstantiationType.Eager +) + +registerSingleton( + IExtensionsScannerService, + class ExtensionsScannerService implements IExtensionsScannerService { + _serviceBrand: undefined + get systemExtensionsLocation() { + return unsupported() + } - get userExtensionsLocation () { - return unsupported() - } + get userExtensionsLocation() { + return unsupported() + } - onDidChangeCache = Event.None - getTargetPlatform = unsupported - scanAllExtensions = unsupported - scanSystemExtensions = unsupported - scanUserExtensions = unsupported - scanExtensionsUnderDevelopment = unsupported - scanExistingExtension = unsupported - scanOneOrMultipleExtensions = unsupported - scanMultipleExtensions = unsupported - scanMetadata = unsupported - updateMetadata = unsupported - initializeDefaultProfileExtensions = unsupported -}, InstantiationType.Eager) - -registerSingleton(IExtensionsProfileScannerService, class ExtensionsProfileScannerService implements IExtensionsProfileScannerService { - _serviceBrand: undefined - onAddExtensions = Event.None - onDidAddExtensions = Event.None - onRemoveExtensions = Event.None - onDidRemoveExtensions = Event.None - scanProfileExtensions = unsupported - addExtensionsToProfile = unsupported - updateMetadata = unsupported - removeExtensionFromProfile = unsupported -}, InstantiationType.Eager) - -registerSingleton(IExtensionIgnoredRecommendationsService, class ExtensionIgnoredRecommendationsService implements IExtensionIgnoredRecommendationsService { - _serviceBrand: undefined - onDidChangeIgnoredRecommendations = Event.None - ignoredRecommendations = [] - onDidChangeGlobalIgnoredRecommendation = Event.None - globalIgnoredRecommendations = [] - toggleGlobalIgnoredRecommendation = unsupported -}, InstantiationType.Eager) - -registerSingleton(IWorkspaceExtensionsConfigService, class WorkspaceExtensionsConfigService implements IWorkspaceExtensionsConfigService { - _serviceBrand: undefined - onDidChangeExtensionsConfigs = Event.None - getExtensionsConfigs = unsupported - getRecommendations = unsupported - getUnwantedRecommendations = unsupported - toggleRecommendation = unsupported - toggleUnwantedRecommendation = unsupported -}, InstantiationType.Eager) - -registerSingleton(IWorkbenchExtensionEnablementService, class WorkbenchExtensionEnablementService implements IWorkbenchExtensionEnablementService { - _serviceBrand: undefined - getEnablementStates = (extensions: IExtension[]) => extensions.map(() => EnablementState.EnabledGlobally) - onEnablementChanged = Event.None - getEnablementState = () => EnablementState.EnabledGlobally - getDependenciesEnablementStates = () => [] - canChangeEnablement = () => false - canChangeWorkspaceEnablement = () => false - isEnabled = () => true - isEnabledEnablementState = () => true - isDisabledGlobally = () => false - setEnablement = unsupported - updateExtensionsEnablementsWhenWorkspaceTrustChanges = unsupported -}, InstantiationType.Eager) - -registerSingleton(ITunnelService, class TunnelService implements ITunnelService { - _serviceBrand: undefined - canChangeProtocol = false - tunnels = Promise.resolve([]) - canChangePrivacy = false - privacyOptions = [] - onTunnelOpened = Event.None - onTunnelClosed = Event.None - canElevate = false - hasTunnelProvider = false - onAddedTunnelProvider = Event.None - canTunnel = () => false - openTunnel = unsupported - getExistingTunnel = async () => undefined - setEnvironmentTunnel = unsupported - closeTunnel = unsupported - setTunnelProvider = unsupported - setTunnelFeatures = unsupported - isPortPrivileged = () => false -}, InstantiationType.Eager) - -registerSingleton(IFilesConfigurationService, class FilesConfigurationService implements IFilesConfigurationService { - _serviceBrand: undefined - onDidChangeAutoSaveConfiguration = Event.None - onDidChangeAutoSaveDisabled = Event.None - hasShortAutoSaveDelay = () => false - disableAutoSave = unsupported - onDidChangeReadonly = Event.None - onDidChangeFilesAssociation = Event.None - onAutoSaveConfigurationChange = Event.None - getAutoSaveConfiguration = unsupported - getAutoSaveMode = unsupported - toggleAutoSave = unsupported - onReadonlyChange = Event.None - isReadonly = unsupported - updateReadonly = unsupported - onFilesAssociationChange = Event.None - isHotExitEnabled = true - hotExitConfiguration = undefined - preventSaveConflicts = unsupported -}, InstantiationType.Eager) - -registerSingleton(IUntitledTextEditorService, class UntitledTextEditorService implements IUntitledTextEditorService { - _serviceBrand: undefined - onDidCreate = Event.None - canDispose = (): true | Promise => true - isUntitledWithAssociatedResource = () => false - onDidChangeDirty = Event.None - onDidChangeEncoding = Event.None - onDidChangeLabel = Event.None - onWillDispose = Event.None - create = unsupported - get = () => undefined - getValue = () => undefined - resolve = unsupported -}, InstantiationType.Eager) + onDidChangeCache = Event.None + getTargetPlatform = unsupported + scanAllExtensions = unsupported + scanSystemExtensions = unsupported + scanUserExtensions = unsupported + scanExtensionsUnderDevelopment = unsupported + scanExistingExtension = unsupported + scanOneOrMultipleExtensions = unsupported + scanMultipleExtensions = unsupported + scanMetadata = unsupported + updateMetadata = unsupported + initializeDefaultProfileExtensions = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IExtensionsProfileScannerService, + class ExtensionsProfileScannerService implements IExtensionsProfileScannerService { + _serviceBrand: undefined + onAddExtensions = Event.None + onDidAddExtensions = Event.None + onRemoveExtensions = Event.None + onDidRemoveExtensions = Event.None + scanProfileExtensions = unsupported + addExtensionsToProfile = unsupported + updateMetadata = unsupported + removeExtensionFromProfile = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IExtensionIgnoredRecommendationsService, + class ExtensionIgnoredRecommendationsService implements IExtensionIgnoredRecommendationsService { + _serviceBrand: undefined + onDidChangeIgnoredRecommendations = Event.None + ignoredRecommendations = [] + onDidChangeGlobalIgnoredRecommendation = Event.None + globalIgnoredRecommendations = [] + toggleGlobalIgnoredRecommendation = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IWorkspaceExtensionsConfigService, + class WorkspaceExtensionsConfigService implements IWorkspaceExtensionsConfigService { + _serviceBrand: undefined + onDidChangeExtensionsConfigs = Event.None + getExtensionsConfigs = unsupported + getRecommendations = unsupported + getUnwantedRecommendations = unsupported + toggleRecommendation = unsupported + toggleUnwantedRecommendation = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IWorkbenchExtensionEnablementService, + class WorkbenchExtensionEnablementService implements IWorkbenchExtensionEnablementService { + _serviceBrand: undefined + getEnablementStates = (extensions: IExtension[]) => + extensions.map(() => EnablementState.EnabledGlobally) + + onEnablementChanged = Event.None + getEnablementState = () => EnablementState.EnabledGlobally + getDependenciesEnablementStates = () => [] + canChangeEnablement = () => false + canChangeWorkspaceEnablement = () => false + isEnabled = () => true + isEnabledEnablementState = () => true + isDisabledGlobally = () => false + setEnablement = unsupported + updateExtensionsEnablementsWhenWorkspaceTrustChanges = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + ITunnelService, + class TunnelService implements ITunnelService { + _serviceBrand: undefined + canChangeProtocol = false + tunnels = Promise.resolve([]) + canChangePrivacy = false + privacyOptions = [] + onTunnelOpened = Event.None + onTunnelClosed = Event.None + canElevate = false + hasTunnelProvider = false + onAddedTunnelProvider = Event.None + canTunnel = () => false + openTunnel = unsupported + getExistingTunnel = async () => undefined + setEnvironmentTunnel = unsupported + closeTunnel = unsupported + setTunnelProvider = unsupported + setTunnelFeatures = unsupported + isPortPrivileged = () => false + }, + InstantiationType.Eager +) + +registerSingleton( + IFilesConfigurationService, + class FilesConfigurationService implements IFilesConfigurationService { + _serviceBrand: undefined + onDidChangeAutoSaveConfiguration = Event.None + onDidChangeAutoSaveDisabled = Event.None + hasShortAutoSaveDelay = () => false + disableAutoSave = unsupported + onDidChangeReadonly = Event.None + onDidChangeFilesAssociation = Event.None + onAutoSaveConfigurationChange = Event.None + getAutoSaveConfiguration = unsupported + getAutoSaveMode = unsupported + toggleAutoSave = unsupported + onReadonlyChange = Event.None + isReadonly = unsupported + updateReadonly = unsupported + onFilesAssociationChange = Event.None + isHotExitEnabled = true + hotExitConfiguration = undefined + preventSaveConflicts = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IUntitledTextEditorService, + class UntitledTextEditorService implements IUntitledTextEditorService { + _serviceBrand: undefined + onDidCreate = Event.None + canDispose = (): true | Promise => true + isUntitledWithAssociatedResource = () => false + onDidChangeDirty = Event.None + onDidChangeEncoding = Event.None + onDidChangeLabel = Event.None + onWillDispose = Event.None + create = unsupported + get = () => undefined + getValue = () => undefined + resolve = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IWorkingCopyBackupService, + class WorkingCopyBackupService implements IWorkingCopyBackupService { + _serviceBrand: undefined + async hasBackups(): Promise { + return false + } -registerSingleton(IWorkingCopyBackupService, class WorkingCopyBackupService implements IWorkingCopyBackupService { - _serviceBrand: undefined - async hasBackups (): Promise { - return false - } + hasBackupSync(): boolean { + return false + } - hasBackupSync (): boolean { - return false - } + async getBackups(): Promise { + return [] + } - async getBackups (): Promise { - return [] - } + async resolve(): Promise< + IResolvedWorkingCopyBackup | undefined + > { + return undefined + } - async resolve (): Promise | undefined> { - return undefined - } + async backup(): Promise {} + + async discardBackup(): Promise {} + + async discardBackups(): Promise {} + }, + InstantiationType.Eager +) +registerSingleton( + IWorkingCopyService, + class WorkingCopyService implements IWorkingCopyService { + _serviceBrand: undefined + onDidRegister = Event.None + onDidUnregister = Event.None + onDidChangeDirty = Event.None + onDidChangeContent = Event.None + onDidSave = Event.None + dirtyCount = 0 + dirtyWorkingCopies = [] + modifiedCount = 0 + modifiedWorkingCopies = [] + hasDirty = false + isDirty = () => false + workingCopies = [] + registerWorkingCopy(): IDisposable { + // ignore + return Disposable.None + } - async backup (): Promise { - } + has = () => false + get = () => undefined + getAll = () => undefined + }, + InstantiationType.Eager +) +registerSingleton( + IDecorationsService, + class DecorationsService implements IDecorationsService { + _serviceBrand: undefined + onDidChangeDecorations = Event.None + registerDecorationsProvider = unsupported + getDecoration = () => undefined + }, + InstantiationType.Eager +) +registerSingleton( + IElevatedFileService, + class ElevatedFileService implements IElevatedFileService { + _serviceBrand: undefined + isSupported = () => false + writeFileElevated = unsupported + }, + InstantiationType.Eager +) +registerSingleton( + IFileDialogService, + class FileDialogService implements IFileDialogService { + preferredHome = unsupported + _serviceBrand: undefined + defaultFilePath = unsupported + defaultFolderPath = unsupported + defaultWorkspacePath = unsupported + pickFileFolderAndOpen = unsupported + pickFileAndOpen = unsupported + pickFolderAndOpen = unsupported + pickWorkspaceAndOpen = unsupported + pickFileToSave = unsupported + showSaveDialog = unsupported + showSaveConfirm = unsupported + showOpenDialog = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IJSONEditingService, + class JSONEditingService implements IJSONEditingService { + _serviceBrand: undefined + write = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IWorkspacesService, + class WorkspacesService implements IWorkspacesService { + _serviceBrand: undefined + enterWorkspace = unsupported + createUntitledWorkspace = unsupported + deleteUntitledWorkspace = unsupported + getWorkspaceIdentifier = unsupported + onDidChangeRecentlyOpened = Event.None + addRecentlyOpened = unsupported + removeRecentlyOpened = unsupported + clearRecentlyOpened = unsupported + getRecentlyOpened = unsupported + getDirtyWorkspaces = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITextEditorService, + class TextEditorService implements ITextEditorService { + _serviceBrand: undefined + createTextEditor = unsupported + resolveTextEditor = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IEditorResolverService, + class EditorResolverService implements IEditorResolverService { + getAllUserAssociations = unsupported + _serviceBrand: undefined + getAssociationsForResource = unsupported + updateUserAssociations = unsupported + onDidChangeEditorRegistrations = Event.None + bufferChangeEvents = unsupported + registerEditor() { + // do nothing + return { + dispose: () => {} + } + } - async discardBackup (): Promise { - } + resolveEditor = unsupported + getEditors = () => [] + }, + InstantiationType.Eager +) + +registerSingleton( + IOutputService, + class OutputService implements IOutputService { + _serviceBrand: undefined + getChannel(): IOutputChannel | undefined { + return undefined + } - async discardBackups (): Promise { - } -}, InstantiationType.Eager) -registerSingleton(IWorkingCopyService, class WorkingCopyService implements IWorkingCopyService { - _serviceBrand: undefined - onDidRegister = Event.None - onDidUnregister = Event.None - onDidChangeDirty = Event.None - onDidChangeContent = Event.None - onDidSave = Event.None - dirtyCount = 0 - dirtyWorkingCopies = [] - modifiedCount = 0 - modifiedWorkingCopies = [] - hasDirty = false - isDirty = () => false - workingCopies = [] - registerWorkingCopy (): IDisposable { - // ignore - return Disposable.None - } + getChannelDescriptor(): IOutputChannelDescriptor | undefined { + return undefined + } - has = () => false - get = () => undefined - getAll = () => undefined -}, InstantiationType.Eager) -registerSingleton(IDecorationsService, class DecorationsService implements IDecorationsService { - _serviceBrand: undefined - onDidChangeDecorations = Event.None - registerDecorationsProvider = unsupported - getDecoration = () => undefined -}, InstantiationType.Eager) -registerSingleton(IElevatedFileService, class ElevatedFileService implements IElevatedFileService { - _serviceBrand: undefined - isSupported = () => false - writeFileElevated = unsupported -}, InstantiationType.Eager) -registerSingleton(IFileDialogService, class FileDialogService implements IFileDialogService { - preferredHome = unsupported - _serviceBrand: undefined - defaultFilePath = unsupported - defaultFolderPath = unsupported - defaultWorkspacePath = unsupported - pickFileFolderAndOpen = unsupported - pickFileAndOpen = unsupported - pickFolderAndOpen = unsupported - pickWorkspaceAndOpen = unsupported - pickFileToSave = unsupported - showSaveDialog = unsupported - showSaveConfirm = unsupported - showOpenDialog = unsupported -}, InstantiationType.Eager) - -registerSingleton(IJSONEditingService, class JSONEditingService implements IJSONEditingService { - _serviceBrand: undefined - write = unsupported -}, InstantiationType.Delayed) + getChannelDescriptors(): IOutputChannelDescriptor[] { + return [] + } -registerSingleton(IWorkspacesService, class WorkspacesService implements IWorkspacesService { - _serviceBrand: undefined - enterWorkspace = unsupported - createUntitledWorkspace = unsupported - deleteUntitledWorkspace = unsupported - getWorkspaceIdentifier = unsupported - onDidChangeRecentlyOpened = Event.None - addRecentlyOpened = unsupported - removeRecentlyOpened = unsupported - clearRecentlyOpened = unsupported - getRecentlyOpened = unsupported - getDirtyWorkspaces = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITextEditorService, class TextEditorService implements ITextEditorService { - _serviceBrand: undefined - createTextEditor = unsupported - resolveTextEditor = unsupported -}, InstantiationType.Eager) + getActiveChannel(): IOutputChannel | undefined { + return undefined + } -registerSingleton(IEditorResolverService, class EditorResolverService implements IEditorResolverService { - getAllUserAssociations = unsupported - _serviceBrand: undefined - getAssociationsForResource = unsupported - updateUserAssociations = unsupported - onDidChangeEditorRegistrations = Event.None - bufferChangeEvents = unsupported - registerEditor () { - // do nothing - return { - dispose: () => {} + async showChannel(): Promise { + // ignore } - } - resolveEditor = unsupported - getEditors = () => ([]) -}, InstantiationType.Eager) + onActiveOutputChannel = Event.None + }, + InstantiationType.Delayed +) + +registerSingleton( + IOutputChannelModelService, + class OutputChannelModelService implements IOutputChannelModelService { + _serviceBrand: undefined + createOutputChannelModel = unsupported + }, + InstantiationType.Delayed +) +registerSingleton( + IExtensionResourceLoaderService, + class ExtensionResourceLoaderService implements IExtensionResourceLoaderService { + _serviceBrand: undefined + readExtensionResource = unsupported + supportsExtensionGalleryResources = false + isExtensionGalleryResource = () => false + getExtensionGalleryResourceURL = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IBuiltinExtensionsScannerService, + class BuiltinExtensionsScannerService implements IBuiltinExtensionsScannerService { + _serviceBrand: undefined + scanBuiltinExtensions() { + return Promise.resolve([]) + } + }, + InstantiationType.Eager +) + +registerSingleton( + IExplorerService, + class ExplorerService implements IExplorerService { + _serviceBrand: undefined + roots = [] + get sortOrderConfiguration() { + return unsupported() + } -registerSingleton(IOutputService, class OutputService implements IOutputService { - _serviceBrand: undefined - getChannel (): IOutputChannel | undefined { - return undefined - } + getContext = unsupported + hasViewFocus = unsupported + setEditable = unsupported + getEditable = unsupported + getEditableData = unsupported + isEditable = unsupported + findClosest = unsupported + findClosestRoot = unsupported + refresh = unsupported + setToCopy = unsupported + isCut = unsupported + applyBulkEdit = unsupported + select = unsupported + registerView = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IExtensionStorageService, + class ExtensionStorageService implements IExtensionStorageService { + _serviceBrand: undefined + getExtensionState = () => undefined + getExtensionStateRaw = () => undefined + setExtensionState = unsupported + onDidChangeExtensionStorageToSync = Event.None + setKeysForSync = unsupported + getKeysForSync = () => undefined + addToMigrationList = unsupported + getSourceExtensionToMigrate = () => undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + IGlobalExtensionEnablementService, + class GlobalExtensionEnablementService implements IGlobalExtensionEnablementService { + _serviceBrand: undefined + onDidChangeEnablement = Event.None + getDisabledExtensions() { + return [] + } - getChannelDescriptor (): IOutputChannelDescriptor | undefined { - return undefined - } + enableExtension() { + return Promise.resolve(true) + } - getChannelDescriptors (): IOutputChannelDescriptor[] { - return [] - } + disableExtension() { + return Promise.resolve(true) + } + }, + InstantiationType.Delayed +) + +registerSingleton( + ILanguagePackService, + class LanguagePackService implements ILanguagePackService { + _serviceBrand: undefined + async getAvailableLanguages(): Promise { + return [] + } - getActiveChannel (): IOutputChannel | undefined { - return undefined - } + async getInstalledLanguages(): Promise { + return [] + } - async showChannel (): Promise { - // ignore - } + async getBuiltInExtensionTranslationsUri( + id: string, + language: string + ): Promise { + const uri = getBuiltInExtensionTranslationsUris(language)?.[id] + return uri != null ? URI.parse(uri) : undefined + } + }, + InstantiationType.Delayed +) + +registerSingleton( + ITreeViewsDnDService, + class TreeViewsDnDService implements ITreeViewsDnDService { + _serviceBrand: undefined + removeDragOperationTransfer = unsupported + addDragOperationTransfer = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IBreadcrumbsService, + class BreadcrumbsService implements IBreadcrumbsService { + _serviceBrand: undefined + register = unsupported + getWidget = () => undefined + }, + InstantiationType.Eager +) + +registerSingleton( + IOutlineService, + class OutlineService implements IOutlineService { + _serviceBrand: undefined + onDidChange = Event.None + canCreateOutline = () => false + createOutline = async () => undefined + registerOutlineCreator = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IUpdateService, + class UpdateService implements IUpdateService { + _serviceBrand: undefined + onStateChange = Event.None + state = State.Uninitialized + checkForUpdates = unsupported + downloadUpdate = unsupported + applyUpdate = unsupported + quitAndInstall = unsupported + isLatestVersion = async () => true + _applySpecificUpdate = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IStatusbarService, + class StatusbarService implements IStatusbarService { + _serviceBrand: undefined + getPart = unsupported + createAuxiliaryStatusbarPart = unsupported + createScoped = unsupported + dispose = unsupported + onDidChangeEntryVisibility = Event.None + addEntry = () => ({ + dispose: () => {}, + update: () => {} + }) - onActiveOutputChannel = Event.None -}, InstantiationType.Delayed) + isEntryVisible = () => false + updateEntryVisibility = () => { + /* ignore */ + } -registerSingleton(IOutputChannelModelService, class OutputChannelModelService implements IOutputChannelModelService { - _serviceBrand: undefined - createOutputChannelModel = unsupported -}, InstantiationType.Delayed) -registerSingleton(IExtensionResourceLoaderService, class ExtensionResourceLoaderService implements IExtensionResourceLoaderService { - _serviceBrand: undefined - readExtensionResource = unsupported - supportsExtensionGalleryResources = false - isExtensionGalleryResource = () => false - getExtensionGalleryResourceURL = unsupported -}, InstantiationType.Eager) + focus = () => { + /* ignore */ + } -registerSingleton(IBuiltinExtensionsScannerService, class BuiltinExtensionsScannerService implements IBuiltinExtensionsScannerService { - _serviceBrand: undefined - scanBuiltinExtensions () { - return Promise.resolve([]) - } -}, InstantiationType.Eager) + focusNextEntry = () => { + /* ignore */ + } -registerSingleton(IExplorerService, class ExplorerService implements IExplorerService { - _serviceBrand: undefined - roots = [] - get sortOrderConfiguration () { return unsupported() } - getContext = unsupported - hasViewFocus = unsupported - setEditable = unsupported - getEditable = unsupported - getEditableData = unsupported - isEditable = unsupported - findClosest = unsupported - findClosestRoot = unsupported - refresh = unsupported - setToCopy = unsupported - isCut = unsupported - applyBulkEdit = unsupported - select = unsupported - registerView = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IExtensionStorageService, class ExtensionStorageService implements IExtensionStorageService { - _serviceBrand: undefined - getExtensionState = () => undefined - getExtensionStateRaw = () => undefined - setExtensionState = unsupported - onDidChangeExtensionStorageToSync = Event.None - setKeysForSync = unsupported - getKeysForSync = () => undefined - addToMigrationList = unsupported - getSourceExtensionToMigrate = () => undefined -}, InstantiationType.Delayed) - -registerSingleton(IGlobalExtensionEnablementService, class GlobalExtensionEnablementService implements IGlobalExtensionEnablementService { - _serviceBrand: undefined - onDidChangeEnablement = Event.None - getDisabledExtensions () { - return [] - } + focusPreviousEntry = () => { + /* ignore */ + } - enableExtension () { - return Promise.resolve(true) - } + isEntryFocused = () => false + overrideStyle = () => Disposable.None + }, + InstantiationType.Eager +) + +registerSingleton( + IExtensionGalleryService, + class ExtensionGalleryService implements IExtensionGalleryService { + _serviceBrand: undefined + isEnabled = () => false + query = unsupported + getExtensions = unsupported + isExtensionCompatible = unsupported + getCompatibleExtension = unsupported + getAllCompatibleVersions = unsupported + download = unsupported + downloadSignatureArchive = unsupported + reportStatistic = unsupported + getReadme = unsupported + getManifest = unsupported + getChangelog = unsupported + getCoreTranslation = unsupported + getExtensionsControlManifest = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + ITerminalService, + class TerminalService implements ITerminalService { + _serviceBrand: undefined + + revealTerminal = unsupported + focusInstance = unsupported + createOnInstanceCapabilityEvent(): IDynamicListEventMultiplexer<{ + instance: ITerminalInstance + data: K + }> { + return { + event: Event.None, + dispose() {} + } + } - disableExtension () { - return Promise.resolve(true) - } -}, InstantiationType.Delayed) + onAnyInstanceData = Event.None + moveIntoNewEditor = unsupported + detachedInstances = [] + onAnyInstanceDataInput = Event.None + onAnyInstanceIconChange = Event.None + onAnyInstanceMaximumDimensionsChange = Event.None + onAnyInstancePrimaryStatusChange = Event.None + onAnyInstanceProcessIdReady = Event.None + onAnyInstanceSelectionChange = Event.None + onAnyInstanceTitleChange = Event.None + createOnInstanceEvent( + getEvent: (instance: ITerminalInstance) => Event + ): DynamicListEventMultiplexer { + return new DynamicListEventMultiplexer( + this.instances, + this.onDidCreateInstance, + this.onDidDisposeInstance, + getEvent + ) + } -registerSingleton(ILanguagePackService, class LanguagePackService implements ILanguagePackService { - _serviceBrand: undefined - async getAvailableLanguages (): Promise { - return [] - } + createDetachedTerminal = unsupported - async getInstalledLanguages (): Promise { - return [] - } + onDidChangeSelection = Event.None - async getBuiltInExtensionTranslationsUri (id: string, language: string): Promise { - const uri = getBuiltInExtensionTranslationsUris(language)?.[id] - return uri != null ? URI.parse(uri) : undefined - } -}, InstantiationType.Delayed) + detachedXterms = [] + whenConnected = Promise.resolve() -registerSingleton(ITreeViewsDnDService, class TreeViewsDnDService implements ITreeViewsDnDService { - _serviceBrand: undefined - removeDragOperationTransfer = unsupported - addDragOperationTransfer = unsupported -}, InstantiationType.Delayed) + restoredGroupCount = 0 + createDetachedXterm = unsupported -registerSingleton(IBreadcrumbsService, class BreadcrumbsService implements IBreadcrumbsService { - _serviceBrand: undefined - register = unsupported - getWidget = () => undefined -}, InstantiationType.Eager) + instances = [] + get configHelper() { + return unsupported() + } -registerSingleton(IOutlineService, class OutlineService implements IOutlineService { - _serviceBrand: undefined - onDidChange = Event.None - canCreateOutline = () => false - createOutline = async () => undefined - registerOutlineCreator = unsupported -}, InstantiationType.Eager) + revealActiveTerminal = unsupported + isProcessSupportRegistered = false + connectionState = TerminalConnectionState.Connected + defaultLocation = TerminalLocation.Panel + onDidChangeActiveGroup = Event.None + onDidDisposeGroup = Event.None + onDidCreateInstance = Event.None + onDidReceiveProcessId = Event.None + onDidChangeInstanceDimensions = Event.None + onDidMaximumDimensionsChange = Event.None + onDidRequestStartExtensionTerminal = Event.None + onDidChangeInstanceTitle = Event.None + onDidChangeInstanceIcon = Event.None + onDidChangeInstanceColor = Event.None + onDidChangeInstancePrimaryStatus = Event.None + onDidInputInstanceData = Event.None + onDidRegisterProcessSupport = Event.None + onDidChangeConnectionState = Event.None + createTerminal = unsupported + getInstanceFromId = unsupported + getInstanceFromIndex = unsupported + getReconnectedTerminals = () => undefined + getActiveOrCreateInstance = unsupported + moveToEditor = unsupported + moveToTerminalView = unsupported + getPrimaryBackend = unsupported + refreshActiveGroup = unsupported + registerProcessSupport = () => {} + showProfileQuickPick = unsupported + setContainers = unsupported + requestStartExtensionTerminal = unsupported + isAttachedToTerminal = unsupported + getEditableData = unsupported + setEditable = unsupported + isEditable = unsupported + safeDisposeTerminal = unsupported + getDefaultInstanceHost = unsupported + getInstanceHost = unsupported + resolveLocation = unsupported + setNativeDelegate = unsupported + toggleEscapeSequenceLogging = unsupported + getEditingTerminal = unsupported + setEditingTerminal = unsupported + activeInstance = undefined + onDidDisposeInstance = Event.None + onDidFocusInstance = Event.None + onDidChangeActiveInstance = Event.None + onDidChangeInstances = Event.None + onDidChangeInstanceCapability = Event.None + setActiveInstance = unsupported + focusActiveInstance = unsupported + getInstanceFromResource = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITerminalConfigurationService, + class TerminalConfigurationService implements ITerminalConfigurationService { + _serviceBrand: undefined + get config() { + return unsupported() + } -registerSingleton(IUpdateService, class UpdateService implements IUpdateService { - _serviceBrand: undefined - onStateChange = Event.None - state = State.Uninitialized - checkForUpdates = unsupported - downloadUpdate = unsupported - applyUpdate = unsupported - quitAndInstall = unsupported - isLatestVersion = async () => true - _applySpecificUpdate = unsupported -}, InstantiationType.Eager) - -registerSingleton(IStatusbarService, class StatusbarService implements IStatusbarService { - _serviceBrand: undefined - getPart = unsupported - createAuxiliaryStatusbarPart = unsupported - createScoped = unsupported - dispose = unsupported - onDidChangeEntryVisibility = Event.None - addEntry = () => ({ - dispose: () => {}, - update: () => {} - }) - - isEntryVisible = () => false - updateEntryVisibility = () => { /* ignore */ } - focus = () => { /* ignore */ } - focusNextEntry = () => { /* ignore */ } - focusPreviousEntry = () => { /* ignore */ } - isEntryFocused = () => false - overrideStyle = () => Disposable.None -}, InstantiationType.Eager) - -registerSingleton(IExtensionGalleryService, class ExtensionGalleryService implements IExtensionGalleryService { - _serviceBrand: undefined - isEnabled = () => false - query = unsupported - getExtensions = unsupported - isExtensionCompatible = unsupported - getCompatibleExtension = unsupported - getAllCompatibleVersions = unsupported - download = unsupported - downloadSignatureArchive = unsupported - reportStatistic = unsupported - getReadme = unsupported - getManifest = unsupported - getChangelog = unsupported - getCoreTranslation = unsupported - getExtensionsControlManifest = unsupported -}, InstantiationType.Eager) - -registerSingleton(ITerminalService, class TerminalService implements ITerminalService { - _serviceBrand: undefined + onConfigChanged = Event.None + setPanelContainer = unsupported + configFontIsMonospace = unsupported + getFont = unsupported + }, + InstantiationType.Delayed +) +registerSingleton( + ITerminalEditorService, + class TerminalEditorService implements ITerminalEditorService { + _serviceBrand: undefined + focusInstance = unsupported + instances = [] + openEditor = unsupported + detachActiveEditorInstance = unsupported + detachInstance = unsupported + splitInstance = unsupported + revealActiveEditor = unsupported + resolveResource = unsupported + reviveInput = unsupported + getInputFromResource = unsupported + activeInstance = undefined + onDidDisposeInstance = Event.None + onDidFocusInstance = Event.None + onDidChangeActiveInstance = Event.None + onDidChangeInstances = Event.None + onDidChangeInstanceCapability = Event.None + setActiveInstance = unsupported + focusActiveInstance = unsupported + getInstanceFromResource = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITerminalGroupService, + class TerminalGroupService implements ITerminalGroupService { + _serviceBrand: undefined + focusInstance = unsupported + lastAccessedMenu: 'inline-tab' | 'tab-list' = 'inline-tab' + instances = [] + groups = [] + activeGroup = undefined + activeGroupIndex = 0 + onDidChangeActiveGroup = Event.None + onDidDisposeGroup = Event.None + onDidChangeGroups = Event.None + onDidShow = Event.None + onDidChangePanelOrientation = Event.None + createGroup = unsupported + getGroupForInstance = unsupported + moveGroup = unsupported + moveGroupToEnd = unsupported + moveInstance = unsupported + unsplitInstance = unsupported + joinInstances = unsupported + instanceIsSplit = unsupported + getGroupLabels = unsupported + setActiveGroupByIndex = unsupported + setActiveGroupToNext = unsupported + setActiveGroupToPrevious = unsupported + setActiveInstanceByIndex = unsupported + setContainer = unsupported + showPanel = unsupported + hidePanel = unsupported + focusTabs = unsupported + focusHover = unsupported + showTabs = unsupported + updateVisibility = unsupported + activeInstance: ITerminalInstance | undefined + onDidDisposeInstance = Event.None + onDidFocusInstance = Event.None + onDidChangeActiveInstance = Event.None + onDidChangeInstances = Event.None + onDidChangeInstanceCapability = Event.None + setActiveInstance = unsupported + focusActiveInstance = unsupported + getInstanceFromResource = unsupported + }, + InstantiationType.Delayed +) +registerSingleton( + ITerminalInstanceService, + class TerminalInstanceService implements ITerminalInstanceService { + _serviceBrand: undefined + getRegisteredBackends = () => [].values() + onDidCreateInstance = Event.None + convertProfileToShellLaunchConfig = unsupported + createInstance = unsupported + getBackend = unsupported + didRegisterBackend = unsupported + }, + InstantiationType.Delayed +) +registerSingleton( + ITerminalProfileService, + class TerminalProfileService implements ITerminalProfileService { + _serviceBrand: undefined + availableProfiles = [] + contributedProfiles = [] + profilesReady = Promise.resolve() + getPlatformKey = unsupported + refreshAvailableProfiles = unsupported + getDefaultProfileName = () => undefined + getDefaultProfile = () => undefined + onDidChangeAvailableProfiles = Event.None + getContributedDefaultProfile = unsupported + registerContributedProfile = unsupported + getContributedProfileProvider = unsupported + registerTerminalProfileProvider = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITerminalLogService, + class TerminalLogService implements ITerminalLogService { + _logBrand: undefined + _serviceBrand: undefined + onDidChangeLogLevel = Event.None + getLevel = unsupported + setLevel = unsupported + trace = unsupported + debug = unsupported + info = unsupported + warn = unsupported + error = unsupported + flush = unsupported + dispose = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITerminalLinkProviderService, + class TerminalLinkProviderService implements ITerminalLinkProviderService { + _serviceBrand: undefined + linkProviders = new Set([]) + onDidAddLinkProvider = Event.None + onDidRemoveLinkProvider = Event.None + registerLinkProvider = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITerminalContributionService, + class TerminalContributionService implements ITerminalContributionService { + _serviceBrand: undefined + terminalProfiles = [] + }, + InstantiationType.Delayed +) + +registerSingleton( + ITerminalProfileResolverService, + class TerminalProfileResolverService implements ITerminalProfileResolverService { + _serviceBrand: undefined + defaultProfileName: string | undefined + resolveIcon = unsupported + resolveShellLaunchConfig = unsupported + getDefaultProfile = async () => ({ + profileName: 'bash', + path: '/bin/bash', + isDefault: true + }) - revealTerminal = unsupported - focusInstance = unsupported - createOnInstanceCapabilityEvent (): IDynamicListEventMultiplexer<{ instance: ITerminalInstance, data: K }> { - return { - event: Event.None, - dispose () {} + getDefaultShell = unsupported + getDefaultShellArgs = unsupported + getDefaultIcon = unsupported + getEnvironment = unsupported + createProfileFromShellAndShellArgs = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IEnvironmentVariableService, + class EnvironmentVariableService implements IEnvironmentVariableService { + _serviceBrand: undefined + collections = new Map() + get mergedCollection() { + return unsupported() } - } - onAnyInstanceData = Event.None - moveIntoNewEditor = unsupported - detachedInstances = [] - onAnyInstanceDataInput = Event.None - onAnyInstanceIconChange = Event.None - onAnyInstanceMaximumDimensionsChange = Event.None - onAnyInstancePrimaryStatusChange = Event.None - onAnyInstanceProcessIdReady = Event.None - onAnyInstanceSelectionChange = Event.None - onAnyInstanceTitleChange = Event.None - createOnInstanceEvent (getEvent: (instance: ITerminalInstance) => Event): DynamicListEventMultiplexer { - return new DynamicListEventMultiplexer(this.instances, this.onDidCreateInstance, this.onDidDisposeInstance, getEvent) - } + onDidChangeCollections = Event.None + set = unsupported + delete = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITerminalQuickFixService, + class TerminalQuickFixService implements ITerminalQuickFixService { + _serviceBrand: undefined + onDidRegisterProvider = Event.None + onDidRegisterCommandSelector = Event.None + onDidUnregisterProvider = Event.None + extensionQuickFixes = Promise.resolve([]) + providers = new Map() + registerQuickFixProvider = unsupported + registerCommandSelector = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataSyncWorkbenchService, + class UserDataSyncWorkbenchService implements IUserDataSyncWorkbenchService { + _serviceBrand: undefined + enabled = false + authenticationProviders = [] + all = [] + current = undefined + accountStatus = AccountStatus.Unavailable + onDidChangeAccountStatus = Event.None + turnOn = unsupported + turnoff = unsupported + signIn = unsupported + resetSyncedData = unsupported + showSyncActivity = unsupported + syncNow = unsupported + synchroniseUserDataSyncStoreType = unsupported + showConflicts = unsupported + accept = unsupported + getAllLogResources = unsupported + downloadSyncActivity = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataSyncEnablementService, + class UserDataSyncEnablementService implements IUserDataSyncEnablementService { + _serviceBrand: undefined + onDidChangeEnablement = Event.None + isEnabled = () => false + canToggleEnablement = () => false + setEnablement = unsupported + onDidChangeResourceEnablement = Event.None + isResourceEnabled = () => false + setResourceEnablement = unsupported + getResourceSyncStateVersion = () => undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + IKeybindingEditingService, + class KeybindingEditingService implements IKeybindingEditingService { + _serviceBrand: undefined + addKeybinding = unsupported + editKeybinding = unsupported + removeKeybinding = unsupported + resetKeybinding = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IPreferencesSearchService, + class PreferencesSearchService implements IPreferencesSearchService { + _serviceBrand: undefined + getLocalSearchProvider = unsupported + getRemoteSearchProvider = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookService, + class NotebookService implements INotebookService { + _serviceBrand: undefined + tryGetDataProviderSync = () => undefined + canResolve = async () => false + onAddViewType = Event.None + onWillRemoveViewType = Event.None + onDidChangeOutputRenderers = Event.None + onWillAddNotebookDocument = Event.None + onDidAddNotebookDocument = Event.None + onWillRemoveNotebookDocument = Event.None + onDidRemoveNotebookDocument = Event.None + registerNotebookSerializer = unsupported + withNotebookDataProvider = unsupported + getOutputMimeTypeInfo = unsupported + getViewTypeProvider = () => undefined + getRendererInfo = () => undefined + getRenderers = () => [] + getStaticPreloads = unsupported + updateMimePreferredRenderer = unsupported + saveMimeDisplayOrder = unsupported + createNotebookTextModel = unsupported + getNotebookTextModel = () => undefined + getNotebookTextModels = unsupported + listNotebookDocuments = () => [] + registerContributedNotebookType = unsupported + getContributedNotebookType = unsupported + getContributedNotebookTypes = () => [] + getNotebookProviderResourceRoots = () => [] + setToCopy = unsupported + getToCopy = unsupported + clearEditorCache = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IReplaceService, + class ReplaceService implements IReplaceService { + _serviceBrand: undefined + replace = unsupported + openReplacePreview = unsupported + updateReplacePreview = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ISearchHistoryService, + class SearchHistoryService implements ISearchHistoryService { + _serviceBrand: undefined + onDidClearHistory = Event.None + clearHistory = unsupported + load = unsupported + save = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookEditorService, + class NotebookEditorService implements INotebookEditorService { + _serviceBrand: undefined + retrieveWidget = unsupported + retrieveExistingWidgetFromURI = () => undefined + retrieveAllExistingWidgets = () => [] + onDidAddNotebookEditor = Event.None + onDidRemoveNotebookEditor = Event.None + addNotebookEditor = unsupported + removeNotebookEditor = unsupported + getNotebookEditor = () => undefined + listNotebookEditors = () => [] + }, + InstantiationType.Delayed +) + +registerSingleton( + ISearchViewModelWorkbenchService, + class SearchWorkbenchService implements ISearchViewModelWorkbenchService { + _serviceBrand: undefined + get searchModel() { + return unsupported() + } + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookEditorModelResolverService, + class NotebookEditorModelResolverService implements INotebookEditorModelResolverService { + _serviceBrand: undefined + createUntitledNotebookTextModel = unsupported + onDidSaveNotebook = Event.None + onDidChangeDirty = Event.None + onWillFailWithConflict = Event.None + isDirty = unsupported + resolve = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IWorkingCopyEditorService, + class WorkingCopyEditorService implements IWorkingCopyEditorService { + _serviceBrand: undefined + onDidRegisterHandler = Event.None + registerHandler = () => Disposable.None + findEditor = () => undefined + }, + InstantiationType.Delayed +) +registerSingleton( + IUserActivityService, + class UserActivityService implements IUserActivityService { + _serviceBrand: undefined + isActive = false + onDidChangeIsActive = Event.None + markActive = unsupported + }, + InstantiationType.Delayed +) +registerSingleton( + ICanonicalUriService, + class CanonicalUriService implements ICanonicalUriService { + _serviceBrand: undefined + registerCanonicalUriProvider = unsupported + }, + InstantiationType.Delayed +) +registerSingleton( + IExtensionStatusBarItemService, + class ExtensionStatusBarItemService implements IExtensionStatusBarItemService { + _serviceBrand: undefined + onDidChange = Event.None + setOrUpdateEntry(): StatusBarUpdateKind { + // ignore + return StatusBarUpdateKind.DidUpdate + } - createDetachedTerminal = unsupported + unsetEntry(): void {} - onDidChangeSelection = Event.None + getEntries(): Iterable { + return [] + } + }, + InstantiationType.Delayed +) +registerSingleton( + IWorkbenchAssignmentService, + class WorkbenchAssignmentService implements IWorkbenchAssignmentService { + _serviceBrand: undefined + getCurrentExperiments = async () => [] + getTreatment = async () => undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + IChatService, + class ChatService implements IChatService { + _serviceBrand: undefined + setChatSessionTitle = unsupported + adoptRequest = unsupported + isEnabled = () => false + resendRequest = unsupported + clearAllHistoryEntries = unsupported + onDidSubmitAgent = Event.None + hasSessions = () => false + onDidDisposeSession = Event.None + transferredSessionData = undefined + onDidSubmitSlashCommand = Event.None + getSessionId = () => undefined + transferredSessionId = undefined + transferChatSession = unsupported + registerSlashCommandProvider = unsupported + getProviderInfos = () => [] + startSession = unsupported + getSession = () => undefined + getOrRestoreSession = () => undefined + loadSessionFromContent = () => undefined + sendRequest = unsupported + removeRequest = unsupported + cancelCurrentRequestForSession = unsupported + getSlashCommands = unsupported + clearSession = unsupported + addRequest = unsupported + addCompleteRequest = unsupported + sendRequestToProvider = unsupported + getHistory = () => [] + removeHistoryEntry = unsupported + onDidPerformUserAction = Event.None + notifyUserAction = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ILanguageModelStatsService, + class LanguageModelStatsService implements ILanguageModelStatsService { + _serviceBrand: undefined + update = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IQuickChatService, + class QuickChatService implements IQuickChatService { + focused = false + _serviceBrand: undefined + onDidClose = Event.None + enabled = false + toggle = unsupported + focus = unsupported + open = unsupported + close = unsupported + openInChatView = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IChatAgentService, + class QuickChatService implements IChatAgentService { + _serviceBrand = undefined + registerChatParticipantDetectionProvider = unsupported + detectAgentOrCommand = unsupported + hasChatParticipantDetectionProviders = () => false + getChatTitle = unsupported + agentHasDupeName = () => false + registerAgentCompletionProvider = unsupported + getAgentCompletionItems = unsupported + getAgentByFullyQualifiedId = unsupported + getContributedDefaultAgent = () => undefined + registerAgentImplementation = unsupported + registerDynamicAgent = unsupported + getActivatedAgents = () => [] + getAgentsByName = () => [] + getFollowups = unsupported + getDefaultAgent = unsupported + getSecondaryAgent = unsupported + updateAgent = unsupported + onDidChangeAgents = Event.None + registerAgentData = unsupported + registerAgentCallback = unsupported + registerAgent = unsupported + invokeAgent = unsupported + getAgents = unsupported + getAgent = unsupported + hasAgent = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IChatAgentNameService, + class ChatAgentNameService implements IChatAgentNameService { + _serviceBrand: undefined + getAgentNameRestriction(): boolean { + return true + } + }, + InstantiationType.Delayed +) +registerSingleton( + IEmbedderTerminalService, + class EmbedderTerminalService implements IEmbedderTerminalService { + _serviceBrand: undefined + onDidCreateTerminal = Event.None + createTerminal = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ICustomEditorService, + class CustomEditorService implements ICustomEditorService { + _serviceBrand: undefined + get models() { + return unsupported() + } - detachedXterms = [] - whenConnected = Promise.resolve() + getCustomEditor = unsupported + getAllCustomEditors = unsupported + getContributedCustomEditors = unsupported + getUserConfiguredCustomEditors = unsupported + registerCustomEditorCapabilities = () => Disposable.None + getCustomEditorCapabilities = () => undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + IWebviewService, + class WebviewService implements IWebviewService { + _serviceBrand: undefined + activeWebview: IWebview | undefined + webviews = [] + onDidChangeActiveWebview = Event.None + createWebviewElement = unsupported + createWebviewOverlay = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IWebviewViewService, + class WebviewService implements IWebviewViewService { + _serviceBrand: undefined + onNewResolverRegistered = Event.None + register = unsupported + resolve = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ILocaleService, + class LocaleService implements ILocaleService { + _serviceBrand: undefined + setLocale = unsupported + + clearLocalePreference() { + return Promise.resolve() + } + }, + InstantiationType.Delayed +) + +registerSingleton( + IWebviewWorkbenchService, + class WebviewWorkbenchService implements IWebviewWorkbenchService { + _serviceBrand: undefined + get iconManager() { + return unsupported() + } - restoredGroupCount = 0 - createDetachedXterm = unsupported + onDidChangeActiveWebviewEditor = Event.None + openWebview = unsupported + openRevivedWebview = unsupported + revealWebview = unsupported + registerResolver = () => Disposable.None + shouldPersist = unsupported + resolveWebview = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IRemoteAuthorityResolverService, + class RemoteAuthorityResolverService implements IRemoteAuthorityResolverService { + _serviceBrand: undefined + onDidChangeConnectionData = Event.None + resolveAuthority = unsupported + getConnectionData = unsupported + getCanonicalURI = unsupported + _clearResolvedAuthority = unsupported + _setResolvedAuthority = unsupported + _setResolvedAuthorityError = unsupported + _setAuthorityConnectionToken = unsupported + _setCanonicalURIProvider = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IExternalUriOpenerService, + class ExternalUriOpenerService implements IExternalUriOpenerService { + _serviceBrand: undefined + registerExternalOpenerProvider = () => Disposable.None + getOpener = async () => undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + IAccessibleViewService, + class AccessibleViewService implements IAccessibleViewService { + _serviceBrand: undefined + configureKeybindings = unsupported + openHelpLink = unsupported + navigateToCodeBlock = unsupported + getCodeBlockContext = () => undefined + showLastProvider = unsupported + showAccessibleViewHelp = unsupported + goToSymbol = unsupported + disableHint = unsupported + next = unsupported + previous = unsupported + getOpenAriaHint = unsupported + show = unsupported + registerProvider = unsupported + getPosition = unsupported + setPosition = unsupported + getLastPosition = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IAccessibleViewInformationService, + class AccessibleViewInformationService implements IAccessibleViewInformationService { + _serviceBrand: undefined + hasShownAccessibleView = () => false + }, + InstantiationType.Delayed +) + +registerSingleton( + IWorkbenchExtensionManagementService, + class WorkbenchExtensionManagementService implements IWorkbenchExtensionManagementService { + _serviceBrand: undefined + onProfileAwareDidInstallExtensions = Event.None + onProfileAwareDidUninstallExtension = Event.None + onProfileAwareDidUpdateExtensionMetadata = Event.None + uninstallExtensions = unsupported + resetPinnedStateForAllUserExtensions = unsupported + getInstalledWorkspaceExtensionLocations = () => [] + onDidEnableExtensions = Event.None + isWorkspaceExtensionsSupported = () => false + getExtensions = async () => [] + getInstalledWorkspaceExtensions = async () => [] + installResourceExtension = unsupported + toggleAppliationScope = async (extension: ILocalExtension) => extension + onInstallExtension = Event.None + onDidInstallExtensions = Event.None + onUninstallExtension = Event.None + onDidUninstallExtension = Event.None + onDidChangeProfile = Event.None + installVSIX = unsupported + installFromLocation = unsupported + updateFromGallery = unsupported + onDidUpdateExtensionMetadata = Event.None + zip = unsupported + unzip = unsupported + getManifest = unsupported + install = unsupported + canInstall = unsupported + installFromGallery = unsupported + installGalleryExtensions = unsupported + installExtensionsFromProfile = unsupported + uninstall = unsupported + reinstallFromGallery = unsupported + getInstalled = async () => [] + getExtensionsControlManifest = unsupported + copyExtensions = unsupported + updateMetadata = unsupported + download = unsupported + registerParticipant = unsupported + getTargetPlatform = unsupported + cleanUp = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IExtensionManifestPropertiesService, + class ExtensionManifestPropertiesService implements IExtensionManifestPropertiesService { + _serviceBrand: undefined + prefersExecuteOnUI = unsupported + prefersExecuteOnWorkspace = unsupported + prefersExecuteOnWeb = unsupported + canExecuteOnUI = unsupported + canExecuteOnWorkspace = unsupported + canExecuteOnWeb = unsupported + getExtensionKind = unsupported + getUserConfiguredExtensionKind = unsupported + getExtensionUntrustedWorkspaceSupportType = unsupported + getExtensionVirtualWorkspaceSupportType = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IWorkspaceTrustEnablementService, + class WorkspaceTrustEnablementService implements IWorkspaceTrustEnablementService { + _serviceBrand: undefined + isWorkspaceTrustEnabled(): boolean { + return false + } + }, + InstantiationType.Delayed +) + +registerSingleton( + IRemoteExtensionsScannerService, + class RemoteExtensionsScannerService implements IRemoteExtensionsScannerService { + _serviceBrand: undefined + whenExtensionsReady(): Promise { + throw new Error('Method not implemented.') + } - instances = [] - get configHelper () { - return unsupported() - } + async scanExtensions(): Promise[]> { + return [] + } - revealActiveTerminal = unsupported - isProcessSupportRegistered = false - connectionState = TerminalConnectionState.Connected - defaultLocation = TerminalLocation.Panel - onDidChangeActiveGroup = Event.None - onDidDisposeGroup = Event.None - onDidCreateInstance = Event.None - onDidReceiveProcessId = Event.None - onDidChangeInstanceDimensions = Event.None - onDidMaximumDimensionsChange = Event.None - onDidRequestStartExtensionTerminal = Event.None - onDidChangeInstanceTitle = Event.None - onDidChangeInstanceIcon = Event.None - onDidChangeInstanceColor = Event.None - onDidChangeInstancePrimaryStatus = Event.None - onDidInputInstanceData = Event.None - onDidRegisterProcessSupport = Event.None - onDidChangeConnectionState = Event.None - createTerminal = unsupported - getInstanceFromId = unsupported - getInstanceFromIndex = unsupported - getReconnectedTerminals = () => undefined - getActiveOrCreateInstance = unsupported - moveToEditor = unsupported - moveToTerminalView = unsupported - getPrimaryBackend = unsupported - refreshActiveGroup = unsupported - registerProcessSupport = () => {} - showProfileQuickPick = unsupported - setContainers = unsupported - requestStartExtensionTerminal = unsupported - isAttachedToTerminal = unsupported - getEditableData = unsupported - setEditable = unsupported - isEditable = unsupported - safeDisposeTerminal = unsupported - getDefaultInstanceHost = unsupported - getInstanceHost = unsupported - resolveLocation = unsupported - setNativeDelegate = unsupported - toggleEscapeSequenceLogging = unsupported - getEditingTerminal = unsupported - setEditingTerminal = unsupported - activeInstance = undefined - onDidDisposeInstance = Event.None - onDidFocusInstance = Event.None - onDidChangeActiveInstance = Event.None - onDidChangeInstances = Event.None - onDidChangeInstanceCapability = Event.None - setActiveInstance = unsupported - focusActiveInstance = unsupported - getInstanceFromResource = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITerminalConfigurationService, class TerminalConfigurationService implements ITerminalConfigurationService { - _serviceBrand: undefined - get config () { - return unsupported() - } + async scanSingleExtension(): Promise | null> { + return null + } + }, + InstantiationType.Delayed +) + +registerSingleton( + IURLService, + class URLService implements IURLService { + _serviceBrand: undefined + create = unsupported + open = async () => false + registerHandler = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IRemoteSocketFactoryService, + class RemoteSocketFactoryService implements IRemoteSocketFactoryService { + _serviceBrand: undefined + register = unsupported + connect = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IQuickDiffService, + class QuickDiffService implements IQuickDiffService { + _serviceBrand: undefined + onDidChangeQuickDiffProviders = Event.None + addQuickDiffProvider = unsupported + getQuickDiffs = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ISCMService, + class SCMService implements ISCMService { + _serviceBrand: undefined + onDidChangeInputValueProviders = Event.None + getDefaultInputValueProvider = unsupported + registerSCMInputValueProvider = unsupported + onDidAddRepository = Event.None + onDidRemoveRepository = Event.None + repositories = [] + repositoryCount = 0 + registerSCMProvider = unsupported + getRepository = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IDownloadService, + class DownloadService implements IDownloadService { + _serviceBrand: undefined + download = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IExtensionUrlHandler, + class ExtensionUrlHandler implements IExtensionUrlHandler { + _serviceBrand: undefined + registerExtensionHandler = unsupported + unregisterExtensionHandler = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ICommentService, + class CommentService implements ICommentService { + _serviceBrand: undefined + lastActiveCommentcontroller = undefined + + get commentsModel() { + return unsupported() + } - onConfigChanged = Event.None - setPanelContainer = unsupported - configFontIsMonospace = unsupported - getFont = unsupported -}, InstantiationType.Delayed) -registerSingleton(ITerminalEditorService, class TerminalEditorService implements ITerminalEditorService { - _serviceBrand: undefined - focusInstance = unsupported - instances = [] - openEditor = unsupported - detachActiveEditorInstance = unsupported - detachInstance = unsupported - splitInstance = unsupported - revealActiveEditor = unsupported - resolveResource = unsupported - reviveInput = unsupported - getInputFromResource = unsupported - activeInstance = undefined - onDidDisposeInstance = Event.None - onDidFocusInstance = Event.None - onDidChangeActiveInstance = Event.None - onDidChangeInstances = Event.None - onDidChangeInstanceCapability = Event.None - setActiveInstance = unsupported - focusActiveInstance = unsupported - getInstanceFromResource = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITerminalGroupService, class TerminalGroupService implements ITerminalGroupService { - _serviceBrand: undefined - focusInstance = unsupported - lastAccessedMenu: 'inline-tab' | 'tab-list' = 'inline-tab' - instances = [] - groups = [] - activeGroup = undefined - activeGroupIndex = 0 - onDidChangeActiveGroup = Event.None - onDidDisposeGroup = Event.None - onDidChangeGroups = Event.None - onDidShow = Event.None - onDidChangePanelOrientation = Event.None - createGroup = unsupported - getGroupForInstance = unsupported - moveGroup = unsupported - moveGroupToEnd = unsupported - moveInstance = unsupported - unsplitInstance = unsupported - joinInstances = unsupported - instanceIsSplit = unsupported - getGroupLabels = unsupported - setActiveGroupByIndex = unsupported - setActiveGroupToNext = unsupported - setActiveGroupToPrevious = unsupported - setActiveInstanceByIndex = unsupported - setContainer = unsupported - showPanel = unsupported - hidePanel = unsupported - focusTabs = unsupported - focusHover = unsupported - showTabs = unsupported - updateVisibility = unsupported - activeInstance: ITerminalInstance | undefined - onDidDisposeInstance = Event.None - onDidFocusInstance = Event.None - onDidChangeActiveInstance = Event.None - onDidChangeInstances = Event.None - onDidChangeInstanceCapability = Event.None - setActiveInstance = unsupported - focusActiveInstance = unsupported - getInstanceFromResource = unsupported -}, InstantiationType.Delayed) -registerSingleton(ITerminalInstanceService, class TerminalInstanceService implements ITerminalInstanceService { - _serviceBrand: undefined - getRegisteredBackends = () => [].values() - onDidCreateInstance = Event.None - convertProfileToShellLaunchConfig = unsupported - createInstance = unsupported - getBackend = unsupported - didRegisterBackend = unsupported -}, InstantiationType.Delayed) -registerSingleton(ITerminalProfileService, class TerminalProfileService implements ITerminalProfileService { - _serviceBrand: undefined - availableProfiles = [] - contributedProfiles = [] - profilesReady = Promise.resolve() - getPlatformKey = unsupported - refreshAvailableProfiles = unsupported - getDefaultProfileName = () => undefined - getDefaultProfile = () => undefined - onDidChangeAvailableProfiles = Event.None - getContributedDefaultProfile = unsupported - registerContributedProfile = unsupported - getContributedProfileProvider = unsupported - registerTerminalProfileProvider = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITerminalLogService, class TerminalLogService implements ITerminalLogService { - _logBrand: undefined - _serviceBrand: undefined - onDidChangeLogLevel = Event.None - getLevel = unsupported - setLevel = unsupported - trace = unsupported - debug = unsupported - info = unsupported - warn = unsupported - error = unsupported - flush = unsupported - dispose = unsupported -}, InstantiationType.Delayed) + resourceHasCommentingRanges = () => false + onDidChangeActiveEditingCommentThread = Event.None + setActiveEditingCommentThread = unsupported + setActiveCommentAndThread = unsupported + + onDidSetResourceCommentInfos = Event.None + onDidSetAllCommentThreads = Event.None + onDidUpdateCommentThreads = Event.None + onDidUpdateNotebookCommentThreads = Event.None + onDidChangeActiveCommentThread = Event.None + onDidChangeCurrentCommentThread = Event.None + onDidUpdateCommentingRanges = Event.None + onDidChangeActiveCommentingRange = Event.None + onDidSetDataProvider = Event.None + onDidDeleteDataProvider = Event.None + onDidChangeCommentingEnabled = Event.None + isCommentingEnabled = false + setDocumentComments = unsupported + setWorkspaceComments = unsupported + removeWorkspaceComments = unsupported + registerCommentController = unsupported + unregisterCommentController = () => {} + getCommentController = unsupported + createCommentThreadTemplate = unsupported + updateCommentThreadTemplate = unsupported + getCommentMenus = unsupported + updateComments = unsupported + updateNotebookComments = unsupported + disposeCommentThread = unsupported + getDocumentComments = async () => [] + getNotebookComments = async () => [] + updateCommentingRanges = unsupported + hasReactionHandler = unsupported + toggleReaction = unsupported + setActiveCommentThread = unsupported + setCurrentCommentThread = unsupported + enableCommenting = unsupported + registerContinueOnCommentProvider = unsupported + removeContinueOnComment = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookCellStatusBarService, + class NotebookCellStatusBarService implements INotebookCellStatusBarService { + _serviceBrand: undefined + onDidChangeProviders = Event.None + onDidChangeItems = Event.None + registerCellStatusBarItemProvider = unsupported + getStatusBarItemsForCell = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookKernelService, + class NotebookKernelService implements INotebookKernelService { + _serviceBrand: undefined + onDidNotebookVariablesUpdate = Event.None + notifyVariablesChange = unsupported + onDidAddKernel = Event.None + onDidRemoveKernel = Event.None + onDidChangeSelectedNotebooks = Event.None + onDidChangeNotebookAffinity = Event.None + registerKernel = unsupported + getMatchingKernel = unsupported + getSelectedOrSuggestedKernel = unsupported + selectKernelForNotebook = unsupported + preselectKernelForNotebook = unsupported + updateKernelNotebookAffinity = unsupported + onDidChangeKernelDetectionTasks = Event.None + registerNotebookKernelDetectionTask = unsupported + getKernelDetectionTasks = unsupported + onDidChangeSourceActions = Event.None + getSourceActions = unsupported + getRunningSourceActions = unsupported + registerKernelSourceActionProvider = unsupported + getKernelSourceActions2 = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookRendererMessagingService, + class NotebookRendererMessagingService implements INotebookRendererMessagingService { + _serviceBrand: undefined + onShouldPostMessage = Event.None + prepare = unsupported + getScoped = unsupported + receiveMessage = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IInteractiveHistoryService, + class InteractiveHistoryService implements IInteractiveHistoryService { + _serviceBrand: undefined + matchesCurrent = () => false + addToHistory = unsupported + getPreviousValue = unsupported + getNextValue = unsupported + replaceLast = unsupported + clearHistory = unsupported + has = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IInteractiveDocumentService, + class InteractiveDocumentService implements IInteractiveDocumentService { + _serviceBrand: undefined + onWillAddInteractiveDocument = Event.None + onWillRemoveInteractiveDocument = Event.None + willCreateInteractiveDocument = unsupported + willRemoveInteractiveDocument = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IActiveLanguagePackService, + class ActiveLanguagePackService implements IActiveLanguagePackService { + readonly _serviceBrand: undefined + async getExtensionIdProvidingCurrentLocale(): Promise { + return getExtensionIdProvidingCurrentLocale() + } + }, + InstantiationType.Eager +) + +registerSingleton( + IRemoteUserDataProfilesService, + class RemoteUserDataProfilesService implements IRemoteUserDataProfilesService { + _serviceBrand: undefined + getRemoteProfiles = async () => [] + getRemoteProfile = unsupported + }, + InstantiationType.Eager +) + +registerSingleton( + IExtensionBisectService, + class ExtensionBisectService implements IExtensionBisectService { + _serviceBrand: undefined + isDisabledByBisect = () => false + isActive = false + disabledCount = 0 + start = unsupported + next = unsupported + reset = unsupported + }, + InstantiationType.Eager +) +registerSingleton( + IUserDataSyncAccountService, + class UserDataSyncAccountService implements IUserDataSyncAccountService { + _serviceBrand: undefined + + readonly onTokenFailed = Event.None + readonly account = undefined + readonly onDidChangeAccount = Event.None + updateAccount(): Promise { + return Promise.resolve() + } + }, + InstantiationType.Eager +) + +registerSingleton( + IChatWidgetService, + class ChatWidgetService implements IChatWidgetService { + _serviceBrand: undefined + getWidgetBySessionId = () => undefined + lastFocusedWidget = undefined + revealViewForProvider = unsupported + getWidgetByInputUri = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IRemoteExplorerService, + class RemoteExplorerService implements IRemoteExplorerService { + onDidChangeHelpInformation = Event.None + get helpInformation() { + return unsupported() + } -registerSingleton(ITerminalLinkProviderService, class TerminalLinkProviderService implements ITerminalLinkProviderService { - _serviceBrand: undefined - linkProviders = new Set([]) - onDidAddLinkProvider = Event.None - onDidRemoveLinkProvider = Event.None - registerLinkProvider = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITerminalContributionService, class TerminalContributionService implements ITerminalContributionService { - _serviceBrand: undefined - terminalProfiles = [] -}, InstantiationType.Delayed) - -registerSingleton(ITerminalProfileResolverService, class TerminalProfileResolverService implements ITerminalProfileResolverService { - _serviceBrand: undefined - defaultProfileName: string | undefined - resolveIcon = unsupported - resolveShellLaunchConfig = unsupported - getDefaultProfile = async () => ({ - profileName: 'bash', - path: '/bin/bash', - isDefault: true - }) - - getDefaultShell = unsupported - getDefaultShellArgs = unsupported - getDefaultIcon = unsupported - getEnvironment = unsupported - createProfileFromShellAndShellArgs = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IEnvironmentVariableService, class EnvironmentVariableService implements IEnvironmentVariableService { - _serviceBrand: undefined - collections = new Map() - get mergedCollection () { - return unsupported() - } - - onDidChangeCollections = Event.None - set = unsupported - delete = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITerminalQuickFixService, class TerminalQuickFixService implements ITerminalQuickFixService { - _serviceBrand: undefined - onDidRegisterProvider = Event.None - onDidRegisterCommandSelector = Event.None - onDidUnregisterProvider = Event.None - extensionQuickFixes = Promise.resolve([]) - providers = new Map() - registerQuickFixProvider = unsupported - registerCommandSelector = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IUserDataSyncWorkbenchService, class UserDataSyncWorkbenchService implements IUserDataSyncWorkbenchService { - _serviceBrand: undefined - enabled = false - authenticationProviders = [] - all = [] - current = undefined - accountStatus = AccountStatus.Unavailable - onDidChangeAccountStatus = Event.None - turnOn = unsupported - turnoff = unsupported - signIn = unsupported - resetSyncedData = unsupported - showSyncActivity = unsupported - syncNow = unsupported - synchroniseUserDataSyncStoreType = unsupported - showConflicts = unsupported - accept = unsupported - getAllLogResources = unsupported - downloadSyncActivity = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IUserDataSyncEnablementService, class UserDataSyncEnablementService implements IUserDataSyncEnablementService { - _serviceBrand: undefined - onDidChangeEnablement = Event.None - isEnabled = () => false - canToggleEnablement = () => false - setEnablement = unsupported - onDidChangeResourceEnablement = Event.None - isResourceEnabled = () => false - setResourceEnablement = unsupported - getResourceSyncStateVersion = () => undefined -}, InstantiationType.Delayed) - -registerSingleton(IKeybindingEditingService, class KeybindingEditingService implements IKeybindingEditingService { - _serviceBrand: undefined - addKeybinding = unsupported - editKeybinding = unsupported - removeKeybinding = unsupported - resetKeybinding = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IPreferencesSearchService, class PreferencesSearchService implements IPreferencesSearchService { - _serviceBrand: undefined - getLocalSearchProvider = unsupported - getRemoteSearchProvider = unsupported -}, InstantiationType.Delayed) - -registerSingleton(INotebookService, class NotebookService implements INotebookService { - _serviceBrand: undefined - tryGetDataProviderSync = () => undefined - canResolve = async () => false - onAddViewType = Event.None - onWillRemoveViewType = Event.None - onDidChangeOutputRenderers = Event.None - onWillAddNotebookDocument = Event.None - onDidAddNotebookDocument = Event.None - onWillRemoveNotebookDocument = Event.None - onDidRemoveNotebookDocument = Event.None - registerNotebookSerializer = unsupported - withNotebookDataProvider = unsupported - getOutputMimeTypeInfo = unsupported - getViewTypeProvider = () => undefined - getRendererInfo = () => undefined - getRenderers = () => [] - getStaticPreloads = unsupported - updateMimePreferredRenderer = unsupported - saveMimeDisplayOrder = unsupported - createNotebookTextModel = unsupported - getNotebookTextModel = () => undefined - getNotebookTextModels = unsupported - listNotebookDocuments = () => [] - registerContributedNotebookType = unsupported - getContributedNotebookType = unsupported - getContributedNotebookTypes = () => [] - getNotebookProviderResourceRoots = () => [] - setToCopy = unsupported - getToCopy = unsupported - clearEditorCache = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IReplaceService, class ReplaceService implements IReplaceService { - _serviceBrand: undefined - replace = unsupported - openReplacePreview = unsupported - updateReplacePreview = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ISearchHistoryService, class SearchHistoryService implements ISearchHistoryService { - _serviceBrand: undefined - onDidClearHistory = Event.None - clearHistory = unsupported - load = unsupported - save = unsupported -}, InstantiationType.Delayed) - -registerSingleton(INotebookEditorService, class NotebookEditorService implements INotebookEditorService { - _serviceBrand: undefined - retrieveWidget = unsupported - retrieveExistingWidgetFromURI = () => undefined - retrieveAllExistingWidgets = () => [] - onDidAddNotebookEditor = Event.None - onDidRemoveNotebookEditor = Event.None - addNotebookEditor = unsupported - removeNotebookEditor = unsupported - getNotebookEditor = () => undefined - listNotebookEditors = () => [] -}, InstantiationType.Delayed) - -registerSingleton(ISearchViewModelWorkbenchService, class SearchWorkbenchService implements ISearchViewModelWorkbenchService { - _serviceBrand: undefined - get searchModel () { - return unsupported() - } -}, InstantiationType.Delayed) - -registerSingleton(INotebookEditorModelResolverService, class NotebookEditorModelResolverService implements INotebookEditorModelResolverService { - _serviceBrand: undefined - createUntitledNotebookTextModel = unsupported - onDidSaveNotebook = Event.None - onDidChangeDirty = Event.None - onWillFailWithConflict = Event.None - isDirty = unsupported - resolve = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IWorkingCopyEditorService, class WorkingCopyEditorService implements IWorkingCopyEditorService { - _serviceBrand: undefined - onDidRegisterHandler = Event.None - registerHandler = () => Disposable.None - findEditor = () => undefined -}, InstantiationType.Delayed) -registerSingleton(IUserActivityService, class UserActivityService implements IUserActivityService { - _serviceBrand: undefined - isActive = false - onDidChangeIsActive = Event.None - markActive = unsupported -}, InstantiationType.Delayed) -registerSingleton(ICanonicalUriService, class CanonicalUriService implements ICanonicalUriService { - _serviceBrand: undefined - registerCanonicalUriProvider = unsupported -}, InstantiationType.Delayed) -registerSingleton(IExtensionStatusBarItemService, class ExtensionStatusBarItemService implements IExtensionStatusBarItemService { - _serviceBrand: undefined - onDidChange = Event.None - setOrUpdateEntry (): StatusBarUpdateKind { - // ignore - return StatusBarUpdateKind.DidUpdate - } - - unsetEntry (): void { - } - - getEntries (): Iterable { - return [] - } -}, InstantiationType.Delayed) -registerSingleton(IWorkbenchAssignmentService, class WorkbenchAssignmentService implements IWorkbenchAssignmentService { - _serviceBrand: undefined - getCurrentExperiments = async () => [] - getTreatment = async () => undefined -}, InstantiationType.Delayed) - -registerSingleton(IChatService, class ChatService implements IChatService { - _serviceBrand: undefined - setChatSessionTitle = unsupported - adoptRequest = unsupported - isEnabled = () => false - resendRequest = unsupported - clearAllHistoryEntries = unsupported - onDidSubmitAgent = Event.None - hasSessions = () => false - onDidDisposeSession = Event.None - transferredSessionData = undefined - onDidSubmitSlashCommand = Event.None - getSessionId = () => undefined - transferredSessionId = undefined - transferChatSession = unsupported - registerSlashCommandProvider = unsupported - getProviderInfos = () => [] - startSession = unsupported - getSession = () => undefined - getOrRestoreSession = () => undefined - loadSessionFromContent = () => undefined - sendRequest = unsupported - removeRequest = unsupported - cancelCurrentRequestForSession = unsupported - getSlashCommands = unsupported - clearSession = unsupported - addRequest = unsupported - addCompleteRequest = unsupported - sendRequestToProvider = unsupported - getHistory = () => [] - removeHistoryEntry = unsupported - onDidPerformUserAction = Event.None - notifyUserAction = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ILanguageModelStatsService, class LanguageModelStatsService implements ILanguageModelStatsService { - _serviceBrand: undefined - update = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IQuickChatService, class QuickChatService implements IQuickChatService { - focused = false - _serviceBrand: undefined - onDidClose = Event.None - enabled = false - toggle = unsupported - focus = unsupported - open = unsupported - close = unsupported - openInChatView = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IChatAgentService, class QuickChatService implements IChatAgentService { - _serviceBrand = undefined - registerChatParticipantDetectionProvider = unsupported - detectAgentOrCommand = unsupported - hasChatParticipantDetectionProviders = () => false - getChatTitle = unsupported - agentHasDupeName = () => false - registerAgentCompletionProvider = unsupported - getAgentCompletionItems = unsupported - getAgentByFullyQualifiedId = unsupported - getContributedDefaultAgent = () => undefined - registerAgentImplementation = unsupported - registerDynamicAgent = unsupported - getActivatedAgents = () => [] - getAgentsByName = () => [] - getFollowups = unsupported - getDefaultAgent = unsupported - getSecondaryAgent = unsupported - updateAgent = unsupported - onDidChangeAgents = Event.None - registerAgentData = unsupported - registerAgentCallback = unsupported - registerAgent = unsupported - invokeAgent = unsupported - getAgents = unsupported - getAgent = unsupported - hasAgent = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IChatAgentNameService, class ChatAgentNameService implements IChatAgentNameService { - _serviceBrand: undefined - getAgentNameRestriction (): boolean { - return true - } -}, InstantiationType.Delayed) -registerSingleton(IEmbedderTerminalService, class EmbedderTerminalService implements IEmbedderTerminalService { - _serviceBrand: undefined - onDidCreateTerminal = Event.None - createTerminal = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ICustomEditorService, class CustomEditorService implements ICustomEditorService { - _serviceBrand: undefined - get models () { - return unsupported() - } - - getCustomEditor = unsupported - getAllCustomEditors = unsupported - getContributedCustomEditors = unsupported - getUserConfiguredCustomEditors = unsupported - registerCustomEditorCapabilities = () => Disposable.None - getCustomEditorCapabilities = () => undefined -}, InstantiationType.Delayed) - -registerSingleton(IWebviewService, class WebviewService implements IWebviewService { - _serviceBrand: undefined - activeWebview: IWebview | undefined - webviews = [] - onDidChangeActiveWebview = Event.None - createWebviewElement = unsupported - createWebviewOverlay = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IWebviewViewService, class WebviewService implements IWebviewViewService { - _serviceBrand: undefined - onNewResolverRegistered = Event.None - register = unsupported - resolve = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ILocaleService, class LocaleService implements ILocaleService { - _serviceBrand: undefined - setLocale = unsupported - - clearLocalePreference () { - return Promise.resolve() - } -}, InstantiationType.Delayed) - -registerSingleton(IWebviewWorkbenchService, class WebviewWorkbenchService implements IWebviewWorkbenchService { - _serviceBrand: undefined - get iconManager () { - return unsupported() - } - - onDidChangeActiveWebviewEditor = Event.None - openWebview = unsupported - openRevivedWebview = unsupported - revealWebview = unsupported - registerResolver = () => Disposable.None - shouldPersist = unsupported - resolveWebview = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IRemoteAuthorityResolverService, class RemoteAuthorityResolverService implements IRemoteAuthorityResolverService { - _serviceBrand: undefined - onDidChangeConnectionData = Event.None - resolveAuthority = unsupported - getConnectionData = unsupported - getCanonicalURI = unsupported - _clearResolvedAuthority = unsupported - _setResolvedAuthority = unsupported - _setResolvedAuthorityError = unsupported - _setAuthorityConnectionToken = unsupported - _setCanonicalURIProvider = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IExternalUriOpenerService, class ExternalUriOpenerService implements IExternalUriOpenerService { - _serviceBrand: undefined - registerExternalOpenerProvider = () => Disposable.None - getOpener = async () => undefined -}, InstantiationType.Delayed) - -registerSingleton(IAccessibleViewService, class AccessibleViewService implements IAccessibleViewService { - _serviceBrand: undefined - configureKeybindings = unsupported - openHelpLink = unsupported - navigateToCodeBlock = unsupported - getCodeBlockContext = () => undefined - showLastProvider = unsupported - showAccessibleViewHelp = unsupported - goToSymbol = unsupported - disableHint = unsupported - next = unsupported - previous = unsupported - getOpenAriaHint = unsupported - show = unsupported - registerProvider = unsupported - getPosition = unsupported - setPosition = unsupported - getLastPosition = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IAccessibleViewInformationService, class AccessibleViewInformationService implements IAccessibleViewInformationService { - _serviceBrand: undefined - hasShownAccessibleView = () => false -}, InstantiationType.Delayed) - -registerSingleton(IWorkbenchExtensionManagementService, class WorkbenchExtensionManagementService implements IWorkbenchExtensionManagementService { - _serviceBrand: undefined - onProfileAwareDidInstallExtensions = Event.None - onProfileAwareDidUninstallExtension = Event.None - onProfileAwareDidUpdateExtensionMetadata = Event.None - uninstallExtensions = unsupported - resetPinnedStateForAllUserExtensions = unsupported - getInstalledWorkspaceExtensionLocations = () => [] - onDidEnableExtensions = Event.None - isWorkspaceExtensionsSupported = () => false - getExtensions = async () => [] - getInstalledWorkspaceExtensions = async () => [] - installResourceExtension = unsupported - toggleAppliationScope = async (extension: ILocalExtension) => extension - onInstallExtension = Event.None - onDidInstallExtensions = Event.None - onUninstallExtension = Event.None - onDidUninstallExtension = Event.None - onDidChangeProfile = Event.None - installVSIX = unsupported - installFromLocation = unsupported - updateFromGallery = unsupported - onDidUpdateExtensionMetadata = Event.None - zip = unsupported - unzip = unsupported - getManifest = unsupported - install = unsupported - canInstall = unsupported - installFromGallery = unsupported - installGalleryExtensions = unsupported - installExtensionsFromProfile = unsupported - uninstall = unsupported - reinstallFromGallery = unsupported - getInstalled = async () => [] - getExtensionsControlManifest = unsupported - copyExtensions = unsupported - updateMetadata = unsupported - download = unsupported - registerParticipant = unsupported - getTargetPlatform = unsupported - cleanUp = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IExtensionManifestPropertiesService, class ExtensionManifestPropertiesService implements IExtensionManifestPropertiesService { - _serviceBrand: undefined - prefersExecuteOnUI = unsupported - prefersExecuteOnWorkspace = unsupported - prefersExecuteOnWeb = unsupported - canExecuteOnUI = unsupported - canExecuteOnWorkspace = unsupported - canExecuteOnWeb = unsupported - getExtensionKind = unsupported - getUserConfiguredExtensionKind = unsupported - getExtensionUntrustedWorkspaceSupportType = unsupported - getExtensionVirtualWorkspaceSupportType = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IWorkspaceTrustEnablementService, class WorkspaceTrustEnablementService implements IWorkspaceTrustEnablementService { - _serviceBrand: undefined - isWorkspaceTrustEnabled (): boolean { - return false - } -}, InstantiationType.Delayed) - -registerSingleton(IRemoteExtensionsScannerService, class RemoteExtensionsScannerService implements IRemoteExtensionsScannerService { - _serviceBrand: undefined - whenExtensionsReady (): Promise { - throw new Error('Method not implemented.') - } - - async scanExtensions (): Promise[]> { - return [] - } - - async scanSingleExtension (): Promise | null> { - return null - } -}, InstantiationType.Delayed) - -registerSingleton(IURLService, class URLService implements IURLService { - _serviceBrand: undefined - create = unsupported - open = async () => false - registerHandler = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IRemoteSocketFactoryService, class RemoteSocketFactoryService implements IRemoteSocketFactoryService { - _serviceBrand: undefined - register = unsupported - connect = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IQuickDiffService, class QuickDiffService implements IQuickDiffService { - _serviceBrand: undefined - onDidChangeQuickDiffProviders = Event.None - addQuickDiffProvider = unsupported - getQuickDiffs = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ISCMService, class SCMService implements ISCMService { - _serviceBrand: undefined - onDidChangeInputValueProviders = Event.None - getDefaultInputValueProvider = unsupported - registerSCMInputValueProvider = unsupported - onDidAddRepository = Event.None - onDidRemoveRepository = Event.None - repositories = [] - repositoryCount = 0 - registerSCMProvider = unsupported - getRepository = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IDownloadService, class DownloadService implements IDownloadService { - _serviceBrand: undefined - download = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IExtensionUrlHandler, class ExtensionUrlHandler implements IExtensionUrlHandler { - _serviceBrand: undefined - registerExtensionHandler = unsupported - unregisterExtensionHandler = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ICommentService, class CommentService implements ICommentService { - _serviceBrand: undefined - lastActiveCommentcontroller = undefined - - get commentsModel () { - return unsupported() - } - - resourceHasCommentingRanges = () => false - onDidChangeActiveEditingCommentThread = Event.None - setActiveEditingCommentThread = unsupported - setActiveCommentAndThread = unsupported - - onDidSetResourceCommentInfos = Event.None - onDidSetAllCommentThreads = Event.None - onDidUpdateCommentThreads = Event.None - onDidUpdateNotebookCommentThreads = Event.None - onDidChangeActiveCommentThread = Event.None - onDidChangeCurrentCommentThread = Event.None - onDidUpdateCommentingRanges = Event.None - onDidChangeActiveCommentingRange = Event.None - onDidSetDataProvider = Event.None - onDidDeleteDataProvider = Event.None - onDidChangeCommentingEnabled = Event.None - isCommentingEnabled = false - setDocumentComments = unsupported - setWorkspaceComments = unsupported - removeWorkspaceComments = unsupported - registerCommentController = unsupported - unregisterCommentController = () => {} - getCommentController = unsupported - createCommentThreadTemplate = unsupported - updateCommentThreadTemplate = unsupported - getCommentMenus = unsupported - updateComments = unsupported - updateNotebookComments = unsupported - disposeCommentThread = unsupported - getDocumentComments = async () => [] - getNotebookComments = async () => [] - updateCommentingRanges = unsupported - hasReactionHandler = unsupported - toggleReaction = unsupported - setActiveCommentThread = unsupported - setCurrentCommentThread = unsupported - enableCommenting = unsupported - registerContinueOnCommentProvider = unsupported - removeContinueOnComment = unsupported -}, InstantiationType.Delayed) - -registerSingleton(INotebookCellStatusBarService, class NotebookCellStatusBarService implements INotebookCellStatusBarService { - _serviceBrand: undefined - onDidChangeProviders = Event.None - onDidChangeItems = Event.None - registerCellStatusBarItemProvider = unsupported - getStatusBarItemsForCell = unsupported -}, InstantiationType.Delayed) - -registerSingleton(INotebookKernelService, class NotebookKernelService implements INotebookKernelService { - _serviceBrand: undefined - onDidNotebookVariablesUpdate = Event.None - notifyVariablesChange = unsupported - onDidAddKernel = Event.None - onDidRemoveKernel = Event.None - onDidChangeSelectedNotebooks = Event.None - onDidChangeNotebookAffinity = Event.None - registerKernel = unsupported - getMatchingKernel = unsupported - getSelectedOrSuggestedKernel = unsupported - selectKernelForNotebook = unsupported - preselectKernelForNotebook = unsupported - updateKernelNotebookAffinity = unsupported - onDidChangeKernelDetectionTasks = Event.None - registerNotebookKernelDetectionTask = unsupported - getKernelDetectionTasks = unsupported - onDidChangeSourceActions = Event.None - getSourceActions = unsupported - getRunningSourceActions = unsupported - registerKernelSourceActionProvider = unsupported - getKernelSourceActions2 = unsupported -}, InstantiationType.Delayed) - -registerSingleton(INotebookRendererMessagingService, class NotebookRendererMessagingService implements INotebookRendererMessagingService { - _serviceBrand: undefined - onShouldPostMessage = Event.None - prepare = unsupported - getScoped = unsupported - receiveMessage = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IInteractiveHistoryService, class InteractiveHistoryService implements IInteractiveHistoryService { - _serviceBrand: undefined - matchesCurrent = () => false - addToHistory = unsupported - getPreviousValue = unsupported - getNextValue = unsupported - replaceLast = unsupported - clearHistory = unsupported - has = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IInteractiveDocumentService, class InteractiveDocumentService implements IInteractiveDocumentService { - _serviceBrand: undefined - onWillAddInteractiveDocument = Event.None - onWillRemoveInteractiveDocument = Event.None - willCreateInteractiveDocument = unsupported - willRemoveInteractiveDocument = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IActiveLanguagePackService, class ActiveLanguagePackService implements IActiveLanguagePackService { - readonly _serviceBrand: undefined - async getExtensionIdProvidingCurrentLocale (): Promise { - return getExtensionIdProvidingCurrentLocale() - } -}, InstantiationType.Eager) - -registerSingleton(IRemoteUserDataProfilesService, class RemoteUserDataProfilesService implements IRemoteUserDataProfilesService { - _serviceBrand: undefined - getRemoteProfiles = async () => [] - getRemoteProfile = unsupported -}, InstantiationType.Eager) - -registerSingleton(IExtensionBisectService, class ExtensionBisectService implements IExtensionBisectService { - _serviceBrand: undefined - isDisabledByBisect = () => false - isActive = false - disabledCount = 0 - start = unsupported - next = unsupported - reset = unsupported -}, InstantiationType.Eager) -registerSingleton(IUserDataSyncAccountService, class UserDataSyncAccountService implements IUserDataSyncAccountService { - _serviceBrand: undefined - - readonly onTokenFailed = Event.None - readonly account = undefined - readonly onDidChangeAccount = Event.None - updateAccount (): Promise { - return Promise.resolve() - } -}, InstantiationType.Eager) - -registerSingleton(IChatWidgetService, class ChatWidgetService implements IChatWidgetService { - _serviceBrand: undefined - getWidgetBySessionId = () => undefined - lastFocusedWidget = undefined - revealViewForProvider = unsupported - getWidgetByInputUri = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IRemoteExplorerService, class RemoteExplorerService implements IRemoteExplorerService { - onDidChangeHelpInformation = Event.None - get helpInformation () { - return unsupported() - } - - _serviceBrand: undefined - onDidChangeTargetType = Event.None - targetType = [] - get tunnelModel () { - return unsupported() - } - - onDidChangeEditable = Event.None - setEditable = unsupported - getEditableData = unsupported - forward = unsupported - close = unsupported - setTunnelInformation = unsupported - setCandidateFilter = unsupported - onFoundNewCandidates = unsupported - restore = unsupported - enablePortsFeatures = unsupported - onEnabledPortsFeatures = Event.None - portsFeaturesEnabled = PortsEnablement.Disabled - namedProcesses = new Map() -}, InstantiationType.Delayed) - -registerSingleton(IAuthenticationService, class AuthenticationService implements IAuthenticationService { - _serviceBrand: undefined - getAccounts = async () => [] - onDidRegisterAuthenticationProvider = Event.None - onDidUnregisterAuthenticationProvider = Event.None - onDidChangeSessions = Event.None - onDidChangeDeclaredProviders = Event.None - declaredProviders = [] - registerDeclaredAuthenticationProvider = unsupported - unregisterDeclaredAuthenticationProvider = unsupported - isAuthenticationProviderRegistered = () => false - registerAuthenticationProvider = unsupported - unregisterAuthenticationProvider = unsupported - getProviderIds = () => [] - getProvider = unsupported - getSessions = unsupported - createSession = unsupported - removeSession = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IAuthenticationAccessService, class AuthenticationAccessService implements IAuthenticationAccessService { - _serviceBrand: undefined - onDidChangeExtensionSessionAccess = Event.None - isAccessAllowed = () => false - readAllowedExtensions = () => [] - updateAllowedExtensions = unsupported - removeAllowedExtensions = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IAuthenticationExtensionsService, class AuthenticationExtensionsService implements IAuthenticationExtensionsService { - _serviceBrand: undefined - onDidChangeAccountPreference = Event.None - getAccountPreference = () => undefined - updateAccountPreference = unsupported - removeAccountPreference = unsupported - updateSessionPreference = unsupported - getSessionPreference = () => undefined - removeSessionPreference = unsupported - selectSession = unsupported - requestSessionAccess = unsupported - requestNewSession = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IAuthenticationUsageService, class AuthenticationUsageService implements IAuthenticationUsageService { - _serviceBrand: undefined - initializeExtensionUsageCache = unsupported - extensionUsesAuth = async () => false - readAccountUsages = unsupported - removeAccountUsage = unsupported - addAccountUsage = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITimelineService, class TimelineService implements ITimelineService { - _serviceBrand: undefined - onDidChangeProviders = Event.None - onDidChangeTimeline = Event.None - onDidChangeUri = Event.None - registerTimelineProvider = unsupported - unregisterTimelineProvider = unsupported - getSources = () => [] - getTimeline = unsupported - setUri = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITestService, class TestService implements ITestService { - _serviceBrand: undefined - getTestsRelatedToCode = async () => [] - getCodeRelatedToTest = async () => [] - registerExtHost = () => Disposable.None - provideTestFollowups = unsupported - onDidCancelTestRun = Event.None - get excluded () { - return unsupported() - } - - get collection () { - return unsupported() - } - - onWillProcessDiff = Event.None - onDidProcessDiff = Event.None - get showInlineOutput () { - return unsupported() - } - - registerTestController = unsupported - getTestController = () => undefined - refreshTests = unsupported - cancelRefreshTests = unsupported - startContinuousRun = unsupported - runTests = unsupported - runResolvedTests = unsupported - syncTests = unsupported - cancelTestRun = unsupported - publishDiff = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ISecretStorageService, class SecretStorageService implements ISecretStorageService { - _serviceBrand: undefined - onDidChangeSecret = Event.None - type: 'in-memory' = 'in-memory' - get = async () => undefined - set = unsupported - delete = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IShareService, class ShareService implements IShareService { - _serviceBrand: undefined - registerShareProvider = unsupported - getShareActions = () => [] - provideShare = async () => undefined -}, InstantiationType.Delayed) - -registerSingleton(IUserDataProfileImportExportService, class UserDataProfileImportExportService implements IUserDataProfileImportExportService { - _serviceBrand: undefined - createProfileFromTemplate = async () => undefined - resolveProfileTemplate = async () => null - exportProfile2 = unsupported - createFromProfile = unsupported - createProfile = unsupported - editProfile = unsupported - registerProfileContentHandler = () => Disposable.None - unregisterProfileContentHandler = () => {} - exportProfile = unsupported - importProfile = unsupported - showProfileContents = unsupported - createFromCurrentProfile = unsupported - createTroubleshootProfile = unsupported - setProfile = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IWorkbenchIssueService, class WorkbenchIssueService implements IWorkbenchIssueService { - registerIssueDataProvider = unsupported - _serviceBrand: undefined - openReporter = unsupported - openProcessExplorer = unsupported - registerIssueUriRequestHandler = unsupported -}, InstantiationType.Delayed) + _serviceBrand: undefined + onDidChangeTargetType = Event.None + targetType = [] + get tunnelModel() { + return unsupported() + } -registerSingleton(ISCMViewService, class SCMViewService implements ISCMViewService { - _serviceBrand: undefined - get activeRepository () { - return unsupported() - } + onDidChangeEditable = Event.None + setEditable = unsupported + getEditableData = unsupported + forward = unsupported + close = unsupported + setTunnelInformation = unsupported + setCandidateFilter = unsupported + onFoundNewCandidates = unsupported + restore = unsupported + enablePortsFeatures = unsupported + onEnabledPortsFeatures = Event.None + portsFeaturesEnabled = PortsEnablement.Disabled + namedProcesses = new Map() + }, + InstantiationType.Delayed +) + +registerSingleton( + IAuthenticationService, + class AuthenticationService implements IAuthenticationService { + _serviceBrand: undefined + getAccounts = async () => [] + onDidRegisterAuthenticationProvider = Event.None + onDidUnregisterAuthenticationProvider = Event.None + onDidChangeSessions = Event.None + onDidChangeDeclaredProviders = Event.None + declaredProviders = [] + registerDeclaredAuthenticationProvider = unsupported + unregisterDeclaredAuthenticationProvider = unsupported + isAuthenticationProviderRegistered = () => false + registerAuthenticationProvider = unsupported + unregisterAuthenticationProvider = unsupported + getProviderIds = () => [] + getProvider = unsupported + getSessions = unsupported + createSession = unsupported + removeSession = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IAuthenticationAccessService, + class AuthenticationAccessService implements IAuthenticationAccessService { + _serviceBrand: undefined + onDidChangeExtensionSessionAccess = Event.None + isAccessAllowed = () => false + readAllowedExtensions = () => [] + updateAllowedExtensions = unsupported + removeAllowedExtensions = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IAuthenticationExtensionsService, + class AuthenticationExtensionsService implements IAuthenticationExtensionsService { + _serviceBrand: undefined + onDidChangeAccountPreference = Event.None + getAccountPreference = () => undefined + updateAccountPreference = unsupported + removeAccountPreference = unsupported + updateSessionPreference = unsupported + getSessionPreference = () => undefined + removeSessionPreference = unsupported + selectSession = unsupported + requestSessionAccess = unsupported + requestNewSession = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IAuthenticationUsageService, + class AuthenticationUsageService implements IAuthenticationUsageService { + _serviceBrand: undefined + initializeExtensionUsageCache = unsupported + extensionUsesAuth = async () => false + readAccountUsages = unsupported + removeAccountUsage = unsupported + addAccountUsage = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITimelineService, + class TimelineService implements ITimelineService { + _serviceBrand: undefined + onDidChangeProviders = Event.None + onDidChangeTimeline = Event.None + onDidChangeUri = Event.None + registerTimelineProvider = unsupported + unregisterTimelineProvider = unsupported + getSources = () => [] + getTimeline = unsupported + setUri = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITestService, + class TestService implements ITestService { + _serviceBrand: undefined + getTestsRelatedToCode = async () => [] + getCodeRelatedToTest = async () => [] + registerExtHost = () => Disposable.None + provideTestFollowups = unsupported + onDidCancelTestRun = Event.None + get excluded() { + return unsupported() + } - get menus () { - return unsupported() - } + get collection() { + return unsupported() + } - repositories = [] - onDidChangeRepositories = Event.None - visibleRepositories = [] - onDidChangeVisibleRepositories = Event.None - isVisible = () => false - toggleVisibility = unsupported - toggleSortKey = unsupported - focusedRepository = undefined - onDidFocusRepository = Event.None - focus = unsupported -}, InstantiationType.Delayed) - -registerSingleton(INotebookExecutionStateService, class NotebookExecutionStateService implements INotebookExecutionStateService { - _serviceBrand: undefined - onDidChangeExecution = Event.None - onDidChangeLastRunFailState = Event.None - forceCancelNotebookExecutions = unsupported - getCellExecutionsForNotebook = unsupported - getCellExecutionsByHandleForNotebook = unsupported - getCellExecution = unsupported - createCellExecution = unsupported - getExecution = unsupported - createExecution = unsupported - getLastFailedCellForNotebook = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITestProfileService, class TestProfileService implements ITestProfileService { - _serviceBrand: undefined - onDidChange = Event.None - addProfile = unsupported - updateProfile = unsupported - removeProfile = unsupported - capabilitiesForTest = unsupported - configure = unsupported - all = () => [] - getGroupDefaultProfiles = () => [] - setGroupDefaultProfiles = unsupported - getControllerProfiles = () => [] -}, InstantiationType.Delayed) - -registerSingleton(IEncryptionService, class EncryptionService implements IEncryptionService { - setUsePlainTextEncryption = unsupported - getKeyStorageProvider = unsupported - _serviceBrand: undefined - encrypt = unsupported - decrypt = unsupported - isEncryptionAvailable = unsupported -}, InstantiationType.Delayed) + onWillProcessDiff = Event.None + onDidProcessDiff = Event.None + get showInlineOutput() { + return unsupported() + } -registerSingleton(ITestResultService, class TestResultService implements ITestResultService { - _serviceBrand: undefined - onResultsChanged = Event.None - onTestChanged = Event.None - results = [] - clear = unsupported - createLiveResult = unsupported - push = unsupported - getResult = () => undefined - getStateById = () => undefined -}, InstantiationType.Delayed) - -registerSingleton(ITestResultStorage, class TestResultStorage implements ITestResultStorage { - _serviceBrand: undefined - read = unsupported - persist = unsupported -}, InstantiationType.Delayed) + registerTestController = unsupported + getTestController = () => undefined + refreshTests = unsupported + cancelRefreshTests = unsupported + startContinuousRun = unsupported + runTests = unsupported + runResolvedTests = unsupported + syncTests = unsupported + cancelTestRun = unsupported + publishDiff = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ISecretStorageService, + class SecretStorageService implements ISecretStorageService { + _serviceBrand: undefined + onDidChangeSecret = Event.None + type: 'in-memory' = 'in-memory' + get = async () => undefined + set = unsupported + delete = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IShareService, + class ShareService implements IShareService { + _serviceBrand: undefined + registerShareProvider = unsupported + getShareActions = () => [] + provideShare = async () => undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataProfileImportExportService, + class UserDataProfileImportExportService implements IUserDataProfileImportExportService { + _serviceBrand: undefined + createProfileFromTemplate = async () => undefined + resolveProfileTemplate = async () => null + exportProfile2 = unsupported + createFromProfile = unsupported + createProfile = unsupported + editProfile = unsupported + registerProfileContentHandler = () => Disposable.None + unregisterProfileContentHandler = () => {} + exportProfile = unsupported + importProfile = unsupported + showProfileContents = unsupported + createFromCurrentProfile = unsupported + createTroubleshootProfile = unsupported + setProfile = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IWorkbenchIssueService, + class WorkbenchIssueService implements IWorkbenchIssueService { + registerIssueDataProvider = unsupported + _serviceBrand: undefined + openReporter = unsupported + openProcessExplorer = unsupported + registerIssueUriRequestHandler = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ISCMViewService, + class SCMViewService implements ISCMViewService { + _serviceBrand: undefined + get activeRepository() { + return unsupported() + } -registerSingleton(ITestingDecorationsService, class TestingDecorationsService implements ITestingDecorationsService { - _serviceBrand: undefined - updateDecorationsAlternateAction = unsupported - onDidChange = Event.None - invalidateResultMessage = unsupported - syncDecorations = unsupported - getDecoratedTestPosition = unsupported -}, InstantiationType.Delayed) + get menus() { + return unsupported() + } -registerSingleton(IUserDataInitializationService, class UserDataInitializationService implements IUserDataInitializationService { - _serviceBrand: undefined - requiresInitialization = async () => false - whenInitializationFinished = async () => {} - initializeRequiredResources = async () => {} - initializeInstalledExtensions = async () => {} - initializeOtherResources = async () => {} -}, InstantiationType.Delayed) + repositories = [] + onDidChangeRepositories = Event.None + visibleRepositories = [] + onDidChangeVisibleRepositories = Event.None + isVisible = () => false + toggleVisibility = unsupported + toggleSortKey = unsupported + focusedRepository = undefined + onDidFocusRepository = Event.None + focus = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookExecutionStateService, + class NotebookExecutionStateService implements INotebookExecutionStateService { + _serviceBrand: undefined + onDidChangeExecution = Event.None + onDidChangeLastRunFailState = Event.None + forceCancelNotebookExecutions = unsupported + getCellExecutionsForNotebook = unsupported + getCellExecutionsByHandleForNotebook = unsupported + getCellExecution = unsupported + createCellExecution = unsupported + getExecution = unsupported + createExecution = unsupported + getLastFailedCellForNotebook = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITestProfileService, + class TestProfileService implements ITestProfileService { + _serviceBrand: undefined + onDidChange = Event.None + addProfile = unsupported + updateProfile = unsupported + removeProfile = unsupported + capabilitiesForTest = unsupported + configure = unsupported + all = () => [] + getGroupDefaultProfiles = () => [] + setGroupDefaultProfiles = unsupported + getControllerProfiles = () => [] + }, + InstantiationType.Delayed +) + +registerSingleton( + IEncryptionService, + class EncryptionService implements IEncryptionService { + setUsePlainTextEncryption = unsupported + getKeyStorageProvider = unsupported + _serviceBrand: undefined + encrypt = unsupported + decrypt = unsupported + isEncryptionAvailable = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITestResultService, + class TestResultService implements ITestResultService { + _serviceBrand: undefined + onResultsChanged = Event.None + onTestChanged = Event.None + results = [] + clear = unsupported + createLiveResult = unsupported + push = unsupported + getResult = () => undefined + getStateById = () => undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + ITestResultStorage, + class TestResultStorage implements ITestResultStorage { + _serviceBrand: undefined + read = unsupported + persist = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITestingDecorationsService, + class TestingDecorationsService implements ITestingDecorationsService { + _serviceBrand: undefined + updateDecorationsAlternateAction = unsupported + onDidChange = Event.None + invalidateResultMessage = unsupported + syncDecorations = unsupported + getDecoratedTestPosition = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataInitializationService, + class UserDataInitializationService implements IUserDataInitializationService { + _serviceBrand: undefined + requiresInitialization = async () => false + whenInitializationFinished = async () => {} + initializeRequiredResources = async () => {} + initializeInstalledExtensions = async () => {} + initializeOtherResources = async () => {} + }, + InstantiationType.Delayed +) registerSingleton(IDiagnosticsService, NullDiagnosticsService, InstantiationType.Delayed) -registerSingleton(INotebookSearchService, class NotebookSearchService implements INotebookSearchService { - notebookSearch () { - return { - openFilesToScan: new ResourceSet(), - completeData: Promise.resolve({ - results: [], - messages: [] - }), - allScannedFiles: Promise.resolve(new ResourceSet()) +registerSingleton( + INotebookSearchService, + class NotebookSearchService implements INotebookSearchService { + notebookSearch() { + return { + openFilesToScan: new ResourceSet(), + completeData: Promise.resolve({ + results: [], + messages: [] + }), + allScannedFiles: Promise.resolve(new ResourceSet()) + } } - } - - _serviceBrand: undefined -}, InstantiationType.Delayed) - -registerSingleton(ILanguageModelsService, class LanguageModelsService implements ILanguageModelsService { - _serviceBrand: undefined - sendChatRequest = unsupported - selectLanguageModels = unsupported - computeTokenLength = unsupported - onDidChangeLanguageModels = Event.None - getLanguageModelIds = () => [] - lookupLanguageModel = () => undefined - registerLanguageModelChat = unsupported - makeLanguageModelChatRequest = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IChatSlashCommandService, class ChatSlashCommandService implements IChatSlashCommandService { - onDidChangeCommands = unsupported - registerSlashData = unsupported - registerSlashCallback = unsupported - registerSlashCommand = unsupported - executeCommand = unsupported - getCommands = unsupported - hasCommand = unsupported - _serviceBrand: undefined -}, InstantiationType.Delayed) - -registerSingleton(IChatVariablesService, class ChatVariablesService implements IChatVariablesService { - _serviceBrand: undefined - attachContext = unsupported - getVariable = () => undefined - resolveVariable = async () => [] - getDynamicVariables = unsupported - getDynamicReferences = unsupported - registerVariable = unsupported - getVariables = unsupported - resolveVariables = unsupported - hasVariable = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IAiRelatedInformationService, class AiRelatedInformationService implements IAiRelatedInformationService { - isEnabled = () => false - getRelatedInformation = unsupported - registerAiRelatedInformationProvider = unsupported - _serviceBrand: undefined -}, InstantiationType.Delayed) - -registerSingleton(IAiEmbeddingVectorService, class AiEmbeddingVectorService implements IAiEmbeddingVectorService { - _serviceBrand: undefined - isEnabled = () => false - getEmbeddingVector = unsupported - registerAiEmbeddingVectorProvider = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ISignService, class SignService implements ISignService { - _serviceBrand: undefined - private static _nextId = 1 - async createNewMessage (value: string): Promise { - const id = String(SignService._nextId++) - return { - id, - data: value + _serviceBrand: undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + ILanguageModelsService, + class LanguageModelsService implements ILanguageModelsService { + _serviceBrand: undefined + sendChatRequest = unsupported + selectLanguageModels = unsupported + computeTokenLength = unsupported + onDidChangeLanguageModels = Event.None + getLanguageModelIds = () => [] + lookupLanguageModel = () => undefined + registerLanguageModelChat = unsupported + makeLanguageModelChatRequest = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IChatSlashCommandService, + class ChatSlashCommandService implements IChatSlashCommandService { + onDidChangeCommands = unsupported + registerSlashData = unsupported + registerSlashCallback = unsupported + registerSlashCommand = unsupported + executeCommand = unsupported + getCommands = unsupported + hasCommand = unsupported + _serviceBrand: undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + IChatVariablesService, + class ChatVariablesService implements IChatVariablesService { + _serviceBrand: undefined + attachContext = unsupported + getVariable = () => undefined + resolveVariable = async () => [] + getDynamicVariables = unsupported + getDynamicReferences = unsupported + registerVariable = unsupported + getVariables = unsupported + resolveVariables = unsupported + hasVariable = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IAiRelatedInformationService, + class AiRelatedInformationService implements IAiRelatedInformationService { + isEnabled = () => false + getRelatedInformation = unsupported + registerAiRelatedInformationProvider = unsupported + _serviceBrand: undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + IAiEmbeddingVectorService, + class AiEmbeddingVectorService implements IAiEmbeddingVectorService { + _serviceBrand: undefined + isEnabled = () => false + getEmbeddingVector = unsupported + registerAiEmbeddingVectorProvider = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ISignService, + class SignService implements ISignService { + _serviceBrand: undefined + private static _nextId = 1 + + async createNewMessage(value: string): Promise { + const id = String(SignService._nextId++) + return { + id, + data: value + } } - } - async validate (): Promise { - return true - } - - async sign (value: string): Promise { - return value - } -}, InstantiationType.Delayed) - -registerSingleton(ITestingContinuousRunService, class TestingContinuousRunService implements ITestingContinuousRunService { - _serviceBrand: undefined - lastRunProfileIds = new Set() - onDidChange = Event.None - isSpecificallyEnabledFor = () => false - isEnabledForAParentOf = () => false - isEnabledForAChildOf = () => false - isEnabled = () => false - start = unsupported - stop = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITestExplorerFilterState, class TestExplorerFilterState implements ITestExplorerFilterState { - _serviceBrand: undefined - get text () { return unsupported() } - get reveal () { return unsupported() } - onDidRequestInputFocus = Event.None - get globList () { return unsupported() } - get includeTags () { return unsupported() } - get excludeTags () { return unsupported() } - get fuzzy () { return unsupported() } - focusInput = unsupported - setText = unsupported - isFilteringFor = () => false - toggleFilteringFor = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITestingPeekOpener, class TestingPeekOpener implements ITestingPeekOpener { - _serviceBrand: undefined - get historyVisible () { return unsupported() } - tryPeekFirstError = unsupported - peekUri = unsupported - openCurrentInEditor = unsupported - open = unsupported - closeAllPeeks = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IAuxiliaryWindowService, class AuxiliaryWindowService implements IAuxiliaryWindowService { - _serviceBrand: undefined - getWindow = () => undefined - onDidOpenAuxiliaryWindow = Event.None - hasWindow = () => false - open = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ISpeechService, class SpeechService implements ISpeechService { - _serviceBrand: undefined - onDidStartTextToSpeechSession = Event.None - onDidEndTextToSpeechSession = Event.None - hasActiveTextToSpeechSession = false - createTextToSpeechSession = unsupported - onDidChangeHasSpeechProvider = Event.None - onDidStartSpeechToTextSession = Event.None - onDidEndSpeechToTextSession = Event.None - hasActiveSpeechToTextSession = false - onDidStartKeywordRecognition = Event.None - onDidEndKeywordRecognition = Event.None - hasActiveKeywordRecognition = false - recognizeKeyword = unsupported - onDidRegisterSpeechProvider = Event.None - onDidUnregisterSpeechProvider = Event.None - hasSpeechProvider = false - registerSpeechProvider = unsupported - createSpeechToTextSession = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ITestCoverageService, class TestCoverageService implements ITestCoverageService { - _serviceBrand: undefined - get showInline () { - return unsupported() - } - - get filterToTest () { - return unsupported() - } - - get selected () { - return unsupported() - } - - openCoverage = unsupported - closeCoverage = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IChatAccessibilityService, class ChatAccessibilityService implements IChatAccessibilityService { - _serviceBrand: undefined - acceptRequest = unsupported - acceptResponse = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IChatWidgetHistoryService, class ChatWidgetHistoryService implements IChatWidgetHistoryService { - _serviceBrand: undefined - onDidClearHistory = Event.None - clearHistory = unsupported - getHistory = () => [] - saveHistory = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IChatCodeBlockContextProviderService, class ChatCodeBlockContextProviderService implements IChatCodeBlockContextProviderService { - _serviceBrand: undefined - providers = [] - registerProvider = () => Disposable.None -}, InstantiationType.Delayed) - -registerSingleton(IInlineChatSessionService, class InlineChatSessionService implements IInlineChatSessionService { - _serviceBrand: undefined - onDidMoveSession = Event.None - onDidMoveSessio = Event.None - onDidStashSession = Event.None - moveSession = unsupported - getCodeEditor = unsupported - stashSession = unsupported - onWillStartSession = Event.None - onDidEndSession = Event.None - createSession = unsupported - getSession = () => undefined - releaseSession = unsupported - registerSessionKeyComputer = unsupported - recordings = unsupported - dispose = unsupported -}, InstantiationType.Delayed) - -registerSingleton(INotebookEditorWorkerService, class NotebookEditorWorkerService implements INotebookEditorWorkerService { - _serviceBrand: undefined - canComputeDiff = () => false - computeDiff = unsupported - canPromptRecommendation = async () => false -}, InstantiationType.Delayed) - -registerSingleton(INotebookKernelHistoryService, class NotebookKernelHistoryService implements INotebookKernelHistoryService { - _serviceBrand: undefined - getKernels = unsupported - addMostRecentKernel = unsupported -}, InstantiationType.Delayed) - -registerSingleton(INotebookExecutionService, class NotebookExecutionService implements INotebookExecutionService { - _serviceBrand: undefined - executeNotebookCells = unsupported - cancelNotebookCells = unsupported - cancelNotebookCellHandles = unsupported - registerExecutionParticipant = unsupported -}, InstantiationType.Delayed) + async validate(): Promise { + return true + } -registerSingleton(INotebookKeymapService, class NotebookKeymapService implements INotebookKeymapService { - _serviceBrand: undefined -}, InstantiationType.Delayed) + async sign(value: string): Promise { + return value + } + }, + InstantiationType.Delayed +) + +registerSingleton( + ITestingContinuousRunService, + class TestingContinuousRunService implements ITestingContinuousRunService { + _serviceBrand: undefined + lastRunProfileIds = new Set() + onDidChange = Event.None + isSpecificallyEnabledFor = () => false + isEnabledForAParentOf = () => false + isEnabledForAChildOf = () => false + isEnabled = () => false + start = unsupported + stop = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITestExplorerFilterState, + class TestExplorerFilterState implements ITestExplorerFilterState { + _serviceBrand: undefined + get text() { + return unsupported() + } -registerSingleton(INotebookLoggingService, class NotebookLoggingService implements INotebookLoggingService { - _serviceBrand: undefined - info = unsupported - debug = unsupported - warn = unsupported - error = unsupported -}, InstantiationType.Delayed) + get reveal() { + return unsupported() + } -registerSingleton(IWalkthroughsService, class WalkthroughsService implements IWalkthroughsService { - _serviceBrand: undefined - onDidAddWalkthrough = Event.None - onDidRemoveWalkthrough = Event.None - onDidChangeWalkthrough = Event.None - onDidProgressStep = Event.None - getWalkthroughs = unsupported - getWalkthrough = unsupported - registerWalkthrough = unsupported - progressByEvent = unsupported - progressStep = unsupported - deprogressStep = unsupported - markWalkthroughOpened = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IUserDataSyncStoreManagementService, class UserDataSyncStoreManagementService implements IUserDataSyncStoreManagementService { - _serviceBrand: undefined - onDidChangeUserDataSyncStore = Event.None - userDataSyncStore = undefined - switch = unsupported - getPreviousUserDataSyncStore = unsupported -}, InstantiationType.Delayed) + onDidRequestInputFocus = Event.None + get globList() { + return unsupported() + } -registerSingleton(IUserDataSyncStoreService, class UserDataSyncStoreService implements IUserDataSyncStoreService { - _serviceBrand: undefined - onDidChangeDonotMakeRequestsUntil = Event.None - donotMakeRequestsUntil = undefined - onTokenFailed = Event.None - onTokenSucceed = Event.None - setAuthToken = unsupported - manifest = unsupported - readResource = unsupported - writeResource = unsupported - deleteResource = unsupported - getAllResourceRefs = unsupported - resolveResourceContent = unsupported - getAllCollections = unsupported - createCollection = unsupported - deleteCollection = unsupported - getActivityData = unsupported - clear = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IUserDataSyncLogService, class UserDataSyncLogService implements IUserDataSyncLogService { - _serviceBrand: undefined - onDidChangeLogLevel = Event.None - getLevel = unsupported - setLevel = unsupported - trace = unsupported - debug = unsupported - info = unsupported - warn = unsupported - error = unsupported - flush = unsupported - dispose = unsupported -}, InstantiationType.Delayed) + get includeTags() { + return unsupported() + } -registerSingleton(IUserDataSyncService, class UserDataSyncService implements IUserDataSyncService { - _serviceBrand: undefined - status = SyncStatus.Uninitialized - onDidChangeStatus = Event.None - conflicts = [] - onDidChangeConflicts = Event.None - onDidChangeLocal = Event.None - onSyncErrors = Event.None - lastSyncTime: number | undefined - onDidChangeLastSyncTime = Event.None - onDidResetRemote = Event.None - onDidResetLocal = Event.None - createSyncTask = unsupported - createManualSyncTask = unsupported - resolveContent = unsupported - accept = unsupported - reset = unsupported - resetRemote = unsupported - cleanUpRemoteData = unsupported - resetLocal = unsupported - hasLocalData = unsupported - hasPreviouslySynced = unsupported - replace = unsupported - saveRemoteActivityData = unsupported - extractActivityData = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IUserDataSyncMachinesService, class UserDataSyncMachinesService implements IUserDataSyncMachinesService { - _serviceBrand: undefined - onDidChange = Event.None - getMachines = unsupported - addCurrentMachine = unsupported - removeCurrentMachine = unsupported - renameMachine = unsupported - setEnablements = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IUserDataSyncResourceProviderService, class UserDataSyncResourceProviderService implements IUserDataSyncResourceProviderService { - _serviceBrand: undefined - getRemoteSyncedProfiles = unsupported - getLocalSyncedProfiles = unsupported - getRemoteSyncResourceHandles = unsupported - getLocalSyncResourceHandles = unsupported - getAssociatedResources = unsupported - getMachineId = unsupported - getLocalSyncedMachines = unsupported - resolveContent = unsupported - resolveUserDataSyncResource = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IUserDataSyncLocalStoreService, class UserDataSyncLocalStoreService implements IUserDataSyncLocalStoreService { - _serviceBrand: undefined - writeResource = unsupported - getAllResourceRefs = unsupported - resolveResourceContent = unsupported -}, InstantiationType.Delayed) + get excludeTags() { + return unsupported() + } -registerSingleton(IUserDataSyncUtilService, class UserDataSyncUtilService implements IUserDataSyncUtilService { - _serviceBrand: undefined - resolveDefaultCoreIgnoredSettings = async () => [] - resolveUserBindings = unsupported - resolveFormattingOptions = unsupported - resolveDefaultIgnoredSettings = unsupported -}, InstantiationType.Delayed) + get fuzzy() { + return unsupported() + } -registerSingleton(IUserDataProfileManagementService, class UserDataProfileManagementService implements IUserDataProfileManagementService { - _serviceBrand: undefined - getDefaultProfileToUse = unsupported - createProfile = unsupported - createAndEnterProfile = unsupported - createAndEnterTransientProfile = unsupported - removeProfile = unsupported - updateProfile = unsupported - switchProfile = unsupported - getBuiltinProfileTemplates = unsupported -}, InstantiationType.Delayed) + focusInput = unsupported + setText = unsupported + isFilteringFor = () => false + toggleFilteringFor = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITestingPeekOpener, + class TestingPeekOpener implements ITestingPeekOpener { + _serviceBrand: undefined + get historyVisible() { + return unsupported() + } -registerSingleton(IWorkingCopyHistoryService, class WorkingCopyHistoryService implements IWorkingCopyHistoryService { - _serviceBrand: undefined - onDidAddEntry = Event.None - onDidChangeEntry = Event.None - onDidReplaceEntry = Event.None - onDidRemoveEntry = Event.None - onDidMoveEntries = Event.None - onDidRemoveEntries = Event.None - addEntry = unsupported - updateEntry = unsupported - removeEntry = unsupported - moveEntries = unsupported - getEntries = async () => [] - getAll = async () => [] - removeAll = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IInlineChatSavingService, class InlineChatSavingService implements IInlineChatSavingService { - _serviceBrand: undefined - markChanged = unsupported -}, InstantiationType.Delayed) + tryPeekFirstError = unsupported + peekUri = unsupported + openCurrentInEditor = unsupported + open = unsupported + closeAllPeeks = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IAuxiliaryWindowService, + class AuxiliaryWindowService implements IAuxiliaryWindowService { + _serviceBrand: undefined + getWindow = () => undefined + onDidOpenAuxiliaryWindow = Event.None + hasWindow = () => false + open = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ISpeechService, + class SpeechService implements ISpeechService { + _serviceBrand: undefined + onDidStartTextToSpeechSession = Event.None + onDidEndTextToSpeechSession = Event.None + hasActiveTextToSpeechSession = false + createTextToSpeechSession = unsupported + onDidChangeHasSpeechProvider = Event.None + onDidStartSpeechToTextSession = Event.None + onDidEndSpeechToTextSession = Event.None + hasActiveSpeechToTextSession = false + onDidStartKeywordRecognition = Event.None + onDidEndKeywordRecognition = Event.None + hasActiveKeywordRecognition = false + recognizeKeyword = unsupported + onDidRegisterSpeechProvider = Event.None + onDidUnregisterSpeechProvider = Event.None + hasSpeechProvider = false + registerSpeechProvider = unsupported + createSpeechToTextSession = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ITestCoverageService, + class TestCoverageService implements ITestCoverageService { + _serviceBrand: undefined + get showInline() { + return unsupported() + } -registerSingleton(INotebookDocumentService, class NotebookDocumentService implements INotebookDocumentService { - _serviceBrand: undefined - getNotebook = () => undefined - addNotebookDocument = unsupported - removeNotebookDocument = unsupported -}, InstantiationType.Delayed) + get filterToTest() { + return unsupported() + } -registerSingleton(IDebugVisualizerService, class DebugVisualizerService implements IDebugVisualizerService { - _serviceBrand: undefined - registerTree = unsupported - getVisualizedNodeFor = unsupported - getVisualizedChildren = unsupported - editTreeItem = unsupported - getApplicableFor = unsupported - register = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IEditSessionsLogService, class EditSessionsLogService implements IEditSessionsLogService { - _serviceBrand: undefined - onDidChangeLogLevel = Event.None - getLevel = unsupported - setLevel = unsupported - trace = unsupported - debug = unsupported - info = unsupported - warn = unsupported - error = unsupported - flush = unsupported - dispose = unsupported -}, InstantiationType.Delayed) + get selected() { + return unsupported() + } -registerSingleton(IEditSessionsStorageService, class EditSessionsWorkbenchService implements IEditSessionsStorageService { - _serviceBrand: undefined - SIZE_LIMIT = 0 - isSignedIn = false - onDidSignIn = Event.None - onDidSignOut = Event.None - storeClient = undefined - lastReadResources = new Map() - lastWrittenResources = new Map() - initialize = unsupported - read = unsupported - write = unsupported - delete = unsupported - list = unsupported - getMachineById = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IMultiDiffSourceResolverService, class MultiDiffSourceResolverService implements IMultiDiffSourceResolverService { - _serviceBrand: undefined - registerResolver = () => Disposable.None - resolve = async () => undefined -}, InstantiationType.Delayed) + openCoverage = unsupported + closeCoverage = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IChatAccessibilityService, + class ChatAccessibilityService implements IChatAccessibilityService { + _serviceBrand: undefined + acceptRequest = unsupported + acceptResponse = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IChatWidgetHistoryService, + class ChatWidgetHistoryService implements IChatWidgetHistoryService { + _serviceBrand: undefined + onDidClearHistory = Event.None + clearHistory = unsupported + getHistory = () => [] + saveHistory = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IChatCodeBlockContextProviderService, + class ChatCodeBlockContextProviderService implements IChatCodeBlockContextProviderService { + _serviceBrand: undefined + providers = [] + registerProvider = () => Disposable.None + }, + InstantiationType.Delayed +) + +registerSingleton( + IInlineChatSessionService, + class InlineChatSessionService implements IInlineChatSessionService { + _serviceBrand: undefined + onDidMoveSession = Event.None + onDidMoveSessio = Event.None + onDidStashSession = Event.None + moveSession = unsupported + getCodeEditor = unsupported + stashSession = unsupported + onWillStartSession = Event.None + onDidEndSession = Event.None + createSession = unsupported + getSession = () => undefined + releaseSession = unsupported + registerSessionKeyComputer = unsupported + recordings = unsupported + dispose = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookEditorWorkerService, + class NotebookEditorWorkerService implements INotebookEditorWorkerService { + _serviceBrand: undefined + canComputeDiff = () => false + computeDiff = unsupported + canPromptRecommendation = async () => false + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookKernelHistoryService, + class NotebookKernelHistoryService implements INotebookKernelHistoryService { + _serviceBrand: undefined + getKernels = unsupported + addMostRecentKernel = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookExecutionService, + class NotebookExecutionService implements INotebookExecutionService { + _serviceBrand: undefined + executeNotebookCells = unsupported + cancelNotebookCells = unsupported + cancelNotebookCellHandles = unsupported + registerExecutionParticipant = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookKeymapService, + class NotebookKeymapService implements INotebookKeymapService { + _serviceBrand: undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookLoggingService, + class NotebookLoggingService implements INotebookLoggingService { + _serviceBrand: undefined + info = unsupported + debug = unsupported + warn = unsupported + error = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IWalkthroughsService, + class WalkthroughsService implements IWalkthroughsService { + _serviceBrand: undefined + onDidAddWalkthrough = Event.None + onDidRemoveWalkthrough = Event.None + onDidChangeWalkthrough = Event.None + onDidProgressStep = Event.None + getWalkthroughs = unsupported + getWalkthrough = unsupported + registerWalkthrough = unsupported + progressByEvent = unsupported + progressStep = unsupported + deprogressStep = unsupported + markWalkthroughOpened = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataSyncStoreManagementService, + class UserDataSyncStoreManagementService implements IUserDataSyncStoreManagementService { + _serviceBrand: undefined + onDidChangeUserDataSyncStore = Event.None + userDataSyncStore = undefined + switch = unsupported + getPreviousUserDataSyncStore = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataSyncStoreService, + class UserDataSyncStoreService implements IUserDataSyncStoreService { + _serviceBrand: undefined + onDidChangeDonotMakeRequestsUntil = Event.None + donotMakeRequestsUntil = undefined + onTokenFailed = Event.None + onTokenSucceed = Event.None + setAuthToken = unsupported + manifest = unsupported + readResource = unsupported + writeResource = unsupported + deleteResource = unsupported + getAllResourceRefs = unsupported + resolveResourceContent = unsupported + getAllCollections = unsupported + createCollection = unsupported + deleteCollection = unsupported + getActivityData = unsupported + clear = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataSyncLogService, + class UserDataSyncLogService implements IUserDataSyncLogService { + _serviceBrand: undefined + onDidChangeLogLevel = Event.None + getLevel = unsupported + setLevel = unsupported + trace = unsupported + debug = unsupported + info = unsupported + warn = unsupported + error = unsupported + flush = unsupported + dispose = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataSyncService, + class UserDataSyncService implements IUserDataSyncService { + _serviceBrand: undefined + status = SyncStatus.Uninitialized + onDidChangeStatus = Event.None + conflicts = [] + onDidChangeConflicts = Event.None + onDidChangeLocal = Event.None + onSyncErrors = Event.None + lastSyncTime: number | undefined + onDidChangeLastSyncTime = Event.None + onDidResetRemote = Event.None + onDidResetLocal = Event.None + createSyncTask = unsupported + createManualSyncTask = unsupported + resolveContent = unsupported + accept = unsupported + reset = unsupported + resetRemote = unsupported + cleanUpRemoteData = unsupported + resetLocal = unsupported + hasLocalData = unsupported + hasPreviouslySynced = unsupported + replace = unsupported + saveRemoteActivityData = unsupported + extractActivityData = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataSyncMachinesService, + class UserDataSyncMachinesService implements IUserDataSyncMachinesService { + _serviceBrand: undefined + onDidChange = Event.None + getMachines = unsupported + addCurrentMachine = unsupported + removeCurrentMachine = unsupported + renameMachine = unsupported + setEnablements = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataSyncResourceProviderService, + class UserDataSyncResourceProviderService implements IUserDataSyncResourceProviderService { + _serviceBrand: undefined + getRemoteSyncedProfiles = unsupported + getLocalSyncedProfiles = unsupported + getRemoteSyncResourceHandles = unsupported + getLocalSyncResourceHandles = unsupported + getAssociatedResources = unsupported + getMachineId = unsupported + getLocalSyncedMachines = unsupported + resolveContent = unsupported + resolveUserDataSyncResource = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataSyncLocalStoreService, + class UserDataSyncLocalStoreService implements IUserDataSyncLocalStoreService { + _serviceBrand: undefined + writeResource = unsupported + getAllResourceRefs = unsupported + resolveResourceContent = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataSyncUtilService, + class UserDataSyncUtilService implements IUserDataSyncUtilService { + _serviceBrand: undefined + resolveDefaultCoreIgnoredSettings = async () => [] + resolveUserBindings = unsupported + resolveFormattingOptions = unsupported + resolveDefaultIgnoredSettings = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IUserDataProfileManagementService, + class UserDataProfileManagementService implements IUserDataProfileManagementService { + _serviceBrand: undefined + getDefaultProfileToUse = unsupported + createProfile = unsupported + createAndEnterProfile = unsupported + createAndEnterTransientProfile = unsupported + removeProfile = unsupported + updateProfile = unsupported + switchProfile = unsupported + getBuiltinProfileTemplates = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IWorkingCopyHistoryService, + class WorkingCopyHistoryService implements IWorkingCopyHistoryService { + _serviceBrand: undefined + onDidAddEntry = Event.None + onDidChangeEntry = Event.None + onDidReplaceEntry = Event.None + onDidRemoveEntry = Event.None + onDidMoveEntries = Event.None + onDidRemoveEntries = Event.None + addEntry = unsupported + updateEntry = unsupported + removeEntry = unsupported + moveEntries = unsupported + getEntries = async () => [] + getAll = async () => [] + removeAll = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IInlineChatSavingService, + class InlineChatSavingService implements IInlineChatSavingService { + _serviceBrand: undefined + markChanged = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + INotebookDocumentService, + class NotebookDocumentService implements INotebookDocumentService { + _serviceBrand: undefined + getNotebook = () => undefined + addNotebookDocument = unsupported + removeNotebookDocument = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IDebugVisualizerService, + class DebugVisualizerService implements IDebugVisualizerService { + _serviceBrand: undefined + registerTree = unsupported + getVisualizedNodeFor = unsupported + getVisualizedChildren = unsupported + editTreeItem = unsupported + getApplicableFor = unsupported + register = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IEditSessionsLogService, + class EditSessionsLogService implements IEditSessionsLogService { + _serviceBrand: undefined + onDidChangeLogLevel = Event.None + getLevel = unsupported + setLevel = unsupported + trace = unsupported + debug = unsupported + info = unsupported + warn = unsupported + error = unsupported + flush = unsupported + dispose = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IEditSessionsStorageService, + class EditSessionsWorkbenchService implements IEditSessionsStorageService { + _serviceBrand: undefined + SIZE_LIMIT = 0 + isSignedIn = false + onDidSignIn = Event.None + onDidSignOut = Event.None + storeClient = undefined + lastReadResources = new Map() + lastWrittenResources = new Map() + initialize = unsupported + read = unsupported + write = unsupported + delete = unsupported + list = unsupported + getMachineById = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IMultiDiffSourceResolverService, + class MultiDiffSourceResolverService implements IMultiDiffSourceResolverService { + _serviceBrand: undefined + registerResolver = () => Disposable.None + resolve = async () => undefined + }, + InstantiationType.Delayed +) registerSingleton(IWorkspaceTagsService, NoOpWorkspaceTagsService, InstantiationType.Delayed) -registerSingleton(IExtensionFeaturesManagementService, class ExtensionFeaturesManagementService implements IExtensionFeaturesManagementService { - _serviceBrand: undefined - onDidChangeEnablement = Event.None - isEnabled = () => true - setEnablement = unsupported - getEnablementData = unsupported - getAccess = unsupported - onDidChangeAccessData = Event.None - getAccessData = () => undefined - setStatus = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IEditorPaneService, class EditorPaneService implements IEditorPaneService { - _serviceBrand: undefined - onWillInstantiateEditorPane = Event.None - didInstantiateEditorPane = () => false -}, InstantiationType.Delayed) - -registerSingleton(IWorkspaceIdentityService, class WorkspaceIdentityService implements IWorkspaceIdentityService { - _serviceBrand: undefined - matches = unsupported - getWorkspaceStateFolders = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IDefaultLogLevelsService, class DefaultLogLevelsService implements IDefaultLogLevelsService { - _serviceBrand: undefined - onDidChangeDefaultLogLevels = Event.None - getDefaultLogLevel = async () => LogLevel.Off - getDefaultLogLevels = unsupported - setDefaultLogLevel = unsupported - migrateLogLevels = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ICustomEditorLabelService, class CustomEditorLabelService implements ICustomEditorLabelService { - _serviceBrand: undefined - onDidChange = Event.None - getName = () => undefined -}, InstantiationType.Delayed) - -registerSingleton(ITroubleshootIssueService, class TroubleshootIssueService implements ITroubleshootIssueService { - _serviceBrand: undefined - isActive = () => false - start = unsupported - resume = unsupported - stop = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IIntegrityService, class IntegrityService implements IIntegrityService { - _serviceBrand: undefined - async isPure (): Promise { - return { - isPure: false, - proof: [] +registerSingleton( + IExtensionFeaturesManagementService, + class ExtensionFeaturesManagementService implements IExtensionFeaturesManagementService { + _serviceBrand: undefined + onDidChangeEnablement = Event.None + isEnabled = () => true + setEnablement = unsupported + getEnablementData = unsupported + getAccess = unsupported + onDidChangeAccessData = Event.None + getAccessData = () => undefined + setStatus = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IEditorPaneService, + class EditorPaneService implements IEditorPaneService { + _serviceBrand: undefined + onWillInstantiateEditorPane = Event.None + didInstantiateEditorPane = () => false + }, + InstantiationType.Delayed +) + +registerSingleton( + IWorkspaceIdentityService, + class WorkspaceIdentityService implements IWorkspaceIdentityService { + _serviceBrand: undefined + matches = unsupported + getWorkspaceStateFolders = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IDefaultLogLevelsService, + class DefaultLogLevelsService implements IDefaultLogLevelsService { + _serviceBrand: undefined + onDidChangeDefaultLogLevels = Event.None + getDefaultLogLevel = async () => LogLevel.Off + getDefaultLogLevels = unsupported + setDefaultLogLevel = unsupported + migrateLogLevels = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ICustomEditorLabelService, + class CustomEditorLabelService implements ICustomEditorLabelService { + _serviceBrand: undefined + onDidChange = Event.None + getName = () => undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + ITroubleshootIssueService, + class TroubleshootIssueService implements ITroubleshootIssueService { + _serviceBrand: undefined + isActive = () => false + start = unsupported + resume = unsupported + stop = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IIntegrityService, + class IntegrityService implements IIntegrityService { + _serviceBrand: undefined + async isPure(): Promise { + return { + isPure: false, + proof: [] + } } - } -}, InstantiationType.Delayed) - -registerSingleton(ITrustedDomainService, class TrustedDomainService implements ITrustedDomainService { - _serviceBrand: undefined - isValid (): boolean { - return false - } -}, InstantiationType.Delayed) - -registerSingleton(ILanguageModelToolsService, class LanguageModelToolsService implements ILanguageModelToolsService { - _serviceBrand: undefined - getTool = () => undefined - getToolByName = () => undefined - onDidChangeTools = Event.None - registerToolData = unsupported - registerToolImplementation = unsupported - getTools = () => [] - invokeTool = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IIssueFormService, class IssueFormService implements IIssueFormService { - _serviceBrand: undefined - openReporter = unsupported - reloadWithExtensionsDisabled = unsupported - showConfirmCloseDialog = unsupported - showClipboardDialog = unsupported - sendReporterMenu = unsupported - closeReporter = unsupported -}, InstantiationType.Delayed) - -registerSingleton(ICodeMapperService, class CodeMapperService implements ICodeMapperService { - _serviceBrand: undefined - registerCodeMapperProvider = unsupported - mapCode = async () => undefined -}, InstantiationType.Delayed) - -registerSingleton(IChatEditingService, class ChatEditingService implements IChatEditingService { - _serviceBrand: undefined - onDidCreateEditingSession = Event.None - currentEditingSession = null - startOrContinueEditingSession = unsupported -}, InstantiationType.Delayed) - -registerSingleton(IActionViewItemService, class ActionViewItemService implements IActionViewItemService { - _serviceBrand: undefined - onDidChange = Event.None - register = unsupported - lookUp = () => undefined -}, InstantiationType.Delayed) - -registerSingleton(ITreeSitterTokenizationFeature, class TreeSitterTokenizationFeature implements ITreeSitterTokenizationFeature { - _serviceBrand: undefined -}, InstantiationType.Delayed) + }, + InstantiationType.Delayed +) + +registerSingleton( + ITrustedDomainService, + class TrustedDomainService implements ITrustedDomainService { + _serviceBrand: undefined + isValid(): boolean { + return false + } + }, + InstantiationType.Delayed +) + +registerSingleton( + ILanguageModelToolsService, + class LanguageModelToolsService implements ILanguageModelToolsService { + _serviceBrand: undefined + getTool = () => undefined + getToolByName = () => undefined + onDidChangeTools = Event.None + registerToolData = unsupported + registerToolImplementation = unsupported + getTools = () => [] + invokeTool = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IIssueFormService, + class IssueFormService implements IIssueFormService { + _serviceBrand: undefined + openReporter = unsupported + reloadWithExtensionsDisabled = unsupported + showConfirmCloseDialog = unsupported + showClipboardDialog = unsupported + sendReporterMenu = unsupported + closeReporter = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + ICodeMapperService, + class CodeMapperService implements ICodeMapperService { + _serviceBrand: undefined + registerCodeMapperProvider = unsupported + mapCode = async () => undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + IChatEditingService, + class ChatEditingService implements IChatEditingService { + _serviceBrand: undefined + onDidCreateEditingSession = Event.None + currentEditingSession = null + startOrContinueEditingSession = unsupported + }, + InstantiationType.Delayed +) + +registerSingleton( + IActionViewItemService, + class ActionViewItemService implements IActionViewItemService { + _serviceBrand: undefined + onDidChange = Event.None + register = unsupported + lookUp = () => undefined + }, + InstantiationType.Delayed +) + +registerSingleton( + ITreeSitterTokenizationFeature, + class TreeSitterTokenizationFeature implements ITreeSitterTokenizationFeature { + _serviceBrand: undefined + }, + InstantiationType.Delayed +) diff --git a/src/monaco.ts b/src/monaco.ts index 8813fba8..db60cbbb 100644 --- a/src/monaco.ts +++ b/src/monaco.ts @@ -1,19 +1,40 @@ -import { StandaloneKeybindingService, StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices' +import { + StandaloneKeybindingService, + StandaloneServices +} from 'vs/editor/standalone/browser/standaloneServices' import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration' -import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' -import { IStandaloneDiffEditorConstructionOptions, IStandaloneEditorConstructionOptions, StandaloneCodeEditor, StandaloneDiffEditor2, StandaloneEditor } from 'vs/editor/standalone/browser/standaloneCodeEditor' +import { + IInstantiationService, + ServicesAccessor +} from 'vs/platform/instantiation/common/instantiation' +import { + IStandaloneDiffEditorConstructionOptions, + IStandaloneEditorConstructionOptions, + StandaloneCodeEditor, + StandaloneDiffEditor2, + StandaloneEditor +} from 'vs/editor/standalone/browser/standaloneCodeEditor' import { IDiffEditorOptions, IEditorOptions } from 'vs/editor/common/config/editorOptions' import { IEditorConfiguration } from 'vs/workbench/browser/parts/editor/textEditor' import { isObject } from 'vs/base/common/types' import { deepClone, distinct } from 'vs/base/common/objects' import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditor/codeEditorWidget' -import type { create as createEditor, createDiffEditor } from 'vs/editor/standalone/browser/standaloneEditor' +import type { + create as createEditor, + createDiffEditor +} from 'vs/editor/standalone/browser/standaloneEditor' import { errorHandler } from 'vs/base/common/errors' -import { FoldingModel, setCollapseStateForMatchingLines } from 'vs/editor/contrib/folding/browser/foldingModel' +import { + FoldingModel, + setCollapseStateForMatchingLines +} from 'vs/editor/contrib/folding/browser/foldingModel' import { FoldingController } from 'vs/editor/contrib/folding/browser/folding' import { DisposableStore, IDisposable, IReference } from 'vs/base/common/lifecycle' import { Registry } from 'vs/platform/registry/common/platform' -import { IJSONContributionRegistry, Extensions as JsonExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry' +import { + IJSONContributionRegistry, + Extensions as JsonExtensions +} from 'vs/platform/jsonschemas/common/jsonContributionRegistry' import { CommandsRegistry } from 'vs/platform/commands/common/commands' import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions' import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry' @@ -31,7 +52,10 @@ import { StandaloneQuickInputService } from 'vs/editor/standalone/browser/quickI import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/contextkey' import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService' -import { IKeyboardEvent, KeybindingsSchemaContribution } from 'vs/platform/keybinding/common/keybinding' +import { + IKeyboardEvent, + KeybindingsSchemaContribution +} from 'vs/platform/keybinding/common/keybinding' import { KeybindingResolver } from 'vs/platform/keybinding/common/keybindingResolver' import { ResolvedKeybindingItem } from 'vs/platform/keybinding/common/resolvedKeybindingItem' import { Keybinding, ResolvedKeybinding } from 'vs/base/common/keybindings' @@ -47,16 +71,32 @@ import { ILogService } from 'vs/platform/log/common/log.service' import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput.service' import { createInjectedClass } from './tools/injection' import { getService } from './services' -export { EditorContributionInstantiation, registerEditorAction, registerEditorContribution, registerDiffEditorContribution, registerMultiEditorAction, EditorAction, EditorCommand } from 'vs/editor/browser/editorExtensions' +export { + EditorContributionInstantiation, + registerEditorAction, + registerEditorContribution, + registerDiffEditorContribution, + registerMultiEditorAction, + EditorAction, + EditorCommand +} from 'vs/editor/browser/editorExtensions' export { IEditorContribution, IDiffEditorContribution } from 'vs/editor/common/editorCommon' -function computeConfiguration (configuration: IEditorConfiguration, overrides?: Readonly): IEditorOptions { - const editorConfiguration: IEditorOptions = isObject(configuration.editor) ? deepClone(configuration.editor) : Object.create(null) +function computeConfiguration( + configuration: IEditorConfiguration, + overrides?: Readonly +): IEditorOptions { + const editorConfiguration: IEditorOptions = isObject(configuration.editor) + ? deepClone(configuration.editor) + : Object.create(null) Object.assign(editorConfiguration, deepClone(overrides)) return editorConfiguration } -function computeDiffConfiguration (configuration: IEditorConfiguration, overrides?: Readonly): IDiffEditorOptions { +function computeDiffConfiguration( + configuration: IEditorConfiguration, + overrides?: Readonly +): IDiffEditorOptions { const editorConfiguration: IDiffEditorOptions = computeConfiguration(configuration) if (isObject(configuration.diffEditor)) { @@ -67,13 +107,16 @@ function computeDiffConfiguration (configuration: IEditorConfiguration, override delete diffEditorConfiguration.codeLens // User settings defines `diffEditor.wordWrap`, but here we rename that to `diffEditor.diffWordWrap` to avoid collisions with `editor.wordWrap`. - diffEditorConfiguration.diffWordWrap = <'off' | 'on' | 'inherit' | undefined>diffEditorConfiguration.wordWrap + diffEditorConfiguration.diffWordWrap = <'off' | 'on' | 'inherit' | undefined>( + diffEditorConfiguration.wordWrap + ) delete diffEditorConfiguration.wordWrap Object.assign(editorConfiguration, diffEditorConfiguration) } - editorConfiguration.accessibilityVerbose = configuration.accessibility?.verbosity?.diffEditor ?? false + editorConfiguration.accessibilityVerbose = + configuration.accessibility?.verbosity?.diffEditor ?? false Object.assign(editorConfiguration, deepClone(overrides)) @@ -85,38 +128,74 @@ function computeDiffConfiguration (configuration: IEditorConfiguration, override * So instead of just taking the options given by the user via the `updateOptions` method, * it fallbacks on the current configurationService configuration */ -function createConfiguredEditorClass (impl: new (instantiationService: IInstantiationService, domElement: HTMLElement, _options: Readonly) => StandaloneCodeEditor) { +function createConfiguredEditorClass( + impl: new ( + instantiationService: IInstantiationService, + domElement: HTMLElement, + _options: Readonly + ) => StandaloneCodeEditor +) { class ConfiguredStandaloneEditor extends impl { private optionsOverrides: Readonly = {} private lastAppliedEditorOptions?: IEditorOptions - constructor ( + constructor( domElement: HTMLElement, _options: Readonly = {}, @IInstantiationService instantiationService: IInstantiationService, - @ITextResourceConfigurationService private textResourceConfigurationService: ITextResourceConfigurationService + @ITextResourceConfigurationService + private textResourceConfigurationService: ITextResourceConfigurationService ) { // Remove Construction specific options - const { theme, autoDetectHighContrast, model, value, language, accessibilityHelpUrl, ariaContainerElement, overflowWidgetsDomNode, dimension, ...options } = _options - const computedOptions = computeConfiguration(textResourceConfigurationService.getValue(_options.model?.uri), options) - super(instantiationService, domElement, { ...computedOptions, overflowWidgetsDomNode, dimension, theme, autoDetectHighContrast, model, value, language, accessibilityHelpUrl, ariaContainerElement }) + const { + theme, + autoDetectHighContrast, + model, + value, + language, + accessibilityHelpUrl, + ariaContainerElement, + overflowWidgetsDomNode, + dimension, + ...options + } = _options + const computedOptions = computeConfiguration( + textResourceConfigurationService.getValue(_options.model?.uri), + options + ) + super(instantiationService, domElement, { + ...computedOptions, + overflowWidgetsDomNode, + dimension, + theme, + autoDetectHighContrast, + model, + value, + language, + accessibilityHelpUrl, + ariaContainerElement + }) this.lastAppliedEditorOptions = computedOptions this.optionsOverrides = options - this._register(textResourceConfigurationService.onDidChangeConfiguration((e) => { - const resource = this.getModel()?.uri - if (resource != null && e.affectsConfiguration(resource, 'editor')) { - this.updateEditorConfiguration() - } - })) + this._register( + textResourceConfigurationService.onDidChangeConfiguration((e) => { + const resource = this.getModel()?.uri + if (resource != null && e.affectsConfiguration(resource, 'editor')) { + this.updateEditorConfiguration() + } + }) + ) this._register(this.onDidChangeModelLanguage(() => this.updateEditorConfiguration())) this._register(this.onDidChangeModel(() => this.updateEditorConfiguration())) this.updateEditorConfiguration() - const scopedInstantiationService = instantiationService.createChild(new ServiceCollection( - [IContextKeyService, this._contextKeyService] - )) - const resourceContext = this._register(scopedInstantiationService.createInstance(ResourceContextKey)) + const scopedInstantiationService = instantiationService.createChild( + new ServiceCollection([IContextKeyService, this._contextKeyService]) + ) + const resourceContext = this._register( + scopedInstantiationService.createInstance(ResourceContextKey) + ) this.onDidChangeModel((e) => { resourceContext.set(e.newModelUrl) }) @@ -126,14 +205,16 @@ function createConfiguredEditorClass (impl: new (instantiationService: IInstanti /** * This method is widely inspired from vs/workbench/browser/parts/editor/textEditor */ - private updateEditorConfiguration (): void { + private updateEditorConfiguration(): void { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (!this.hasModel() || this.textResourceConfigurationService == null) { // textResourceConfigurationService can be null if this method is called by the constructor of StandaloneEditor return } const resource = this.getModel()!.uri - const configuration = this.textResourceConfigurationService.getValue(resource) + const configuration = this.textResourceConfigurationService.getValue< + IEditorConfiguration | undefined + >(resource) if (configuration == null) { return } @@ -155,7 +236,7 @@ function createConfiguredEditorClass (impl: new (instantiationService: IInstanti } } - override updateOptions (newOptions: Readonly): void { + override updateOptions(newOptions: Readonly): void { // it can be null if this method is called by the constructor of StandaloneEditor // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition this.optionsOverrides ??= {} @@ -171,32 +252,65 @@ function createConfiguredEditorClass (impl: new (instantiationService: IInstanti return ConfiguredStandaloneEditor } -const ConfiguredStandaloneCodeEditor = createConfiguredEditorClass(createInjectedClass(StandaloneCodeEditor)) -const ConfiguredStandaloneEditor = createConfiguredEditorClass(createInjectedClass(StandaloneEditor)) +const ConfiguredStandaloneCodeEditor = createConfiguredEditorClass( + createInjectedClass(StandaloneCodeEditor) +) +const ConfiguredStandaloneEditor = createConfiguredEditorClass( + createInjectedClass(StandaloneEditor) +) class ConfiguredStandaloneDiffEditor extends createInjectedClass(StandaloneDiffEditor2) { private optionsOverrides: Readonly = {} private lastAppliedEditorOptions?: IEditorOptions - constructor ( + constructor( domElement: HTMLElement, _options: Readonly = {}, @IInstantiationService instantiationService: IInstantiationService, - @ITextResourceConfigurationService private textResourceConfigurationService: ITextResourceConfigurationService + @ITextResourceConfigurationService + private textResourceConfigurationService: ITextResourceConfigurationService ) { // Remove Construction specific options - const { theme, autoDetectHighContrast, modifiedAriaLabel, originalAriaLabel, overflowWidgetsDomNode, dimension, ...options } = _options - const computedOptions = computeDiffConfiguration(textResourceConfigurationService.getValue(undefined), options) - super(instantiationService, domElement, { ...computedOptions, overflowWidgetsDomNode, dimension, theme, autoDetectHighContrast, modifiedAriaLabel, originalAriaLabel }) + const { + theme, + autoDetectHighContrast, + modifiedAriaLabel, + originalAriaLabel, + overflowWidgetsDomNode, + dimension, + ...options + } = _options + const computedOptions = computeDiffConfiguration( + textResourceConfigurationService.getValue(undefined), + options + ) + super(instantiationService, domElement, { + ...computedOptions, + overflowWidgetsDomNode, + dimension, + theme, + autoDetectHighContrast, + modifiedAriaLabel, + originalAriaLabel + }) this.lastAppliedEditorOptions = computedOptions this.optionsOverrides = options - this._register(textResourceConfigurationService.onDidChangeConfiguration((e) => { - const resource = this._targetEditor.getModel()?.uri - if (resource != null && (e.affectsConfiguration(resource, 'editor') || e.affectsConfiguration(resource, 'diffEditor') || e.affectsConfiguration(resource, 'accessibility.verbosity.diffEditor'))) { - this.updateEditorConfiguration() - } - })) - this._register(this._targetEditor.onDidChangeModelLanguage(() => this.updateEditorConfiguration())) + this._register( + textResourceConfigurationService.onDidChangeConfiguration((e) => { + const resource = this._targetEditor.getModel()?.uri + if ( + resource != null && + (e.affectsConfiguration(resource, 'editor') || + e.affectsConfiguration(resource, 'diffEditor') || + e.affectsConfiguration(resource, 'accessibility.verbosity.diffEditor')) + ) { + this.updateEditorConfiguration() + } + }) + ) + this._register( + this._targetEditor.onDidChangeModelLanguage(() => this.updateEditorConfiguration()) + ) this._register(this.onDidChangeModel(() => this.updateEditorConfiguration())) this.updateEditorConfiguration() } @@ -204,14 +318,16 @@ class ConfiguredStandaloneDiffEditor extends createInjectedClass(StandaloneDiffE /** * This method is widely inspired from vs/workbench/browser/parts/editor/textEditor */ - private updateEditorConfiguration (): void { + private updateEditorConfiguration(): void { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (this.getModel() == null || this.textResourceConfigurationService == null) { // textResourceConfigurationService can be null if this method is called by the constructor of StandaloneEditor return } const resource = this._targetEditor.getModel()?.uri - const configuration = this.textResourceConfigurationService.getValue(resource) + const configuration = this.textResourceConfigurationService.getValue< + IEditorConfiguration | undefined + >(resource) if (configuration == null) { return } @@ -233,7 +349,7 @@ class ConfiguredStandaloneDiffEditor extends createInjectedClass(StandaloneDiffE } } - override updateOptions (newOptions: Readonly): void { + override updateOptions(newOptions: Readonly): void { // it can be null if this method is called by the constructor of StandaloneEditor // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition this.optionsOverrides ??= {} @@ -246,22 +362,29 @@ class ConfiguredStandaloneDiffEditor extends createInjectedClass(StandaloneDiffE this.updateEditorConfiguration() } - protected override _createInnerEditor (instantiationService: IInstantiationService, container: HTMLElement, options: Readonly): CodeEditorWidget { + protected override _createInnerEditor( + instantiationService: IInstantiationService, + container: HTMLElement, + options: Readonly + ): CodeEditorWidget { return instantiationService.createInstance(ConfiguredStandaloneCodeEditor, container, options) } } -export async function writeFile (uri: URI, content: string): Promise { +export async function writeFile(uri: URI, content: string): Promise { const fileService = await getService(IFileService) await fileService.writeFile(uri, VSBuffer.fromString(content)) } -export async function deleteFile (uri: URI, options?: Partial): Promise { +export async function deleteFile(uri: URI, options?: Partial): Promise { const fileService = await getService(IFileService) await fileService.del(uri, options) } -export async function createModelReference (resource: URI, content?: string): Promise> { +export async function createModelReference( + resource: URI, + content?: string +): Promise> { if (content != null) { await writeFile(resource, content) } @@ -270,16 +393,16 @@ export async function createModelReference (resource: URI, content?: string): Pr } export interface KeybindingProvider { - provideKeybindings (): ResolvedKeybindingItem[] + provideKeybindings(): ResolvedKeybindingItem[] onDidChangeKeybindings: Event } export interface DynamicKeybindingService extends IKeybindingService { - registerKeybindingProvider (provider: KeybindingProvider): IDisposable + registerKeybindingProvider(provider: KeybindingProvider): IDisposable _getResolver(): KeybindingResolver } -function isDynamicKeybindingService (keybindingService: IKeybindingService) { +function isDynamicKeybindingService(keybindingService: IKeybindingService) { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition return (keybindingService as DynamicKeybindingService).registerKeybindingProvider != null } @@ -287,7 +410,7 @@ function isDynamicKeybindingService (keybindingService: IKeybindingService) { // This class use useful so editor.addAction and editor.addCommand still work // Monaco do an `instanceof` on the KeybindingService so we need it to extends `StandaloneKeybindingService` class DelegateStandaloneKeybindingService extends StandaloneKeybindingService { - constructor ( + constructor( private delegate: DynamicKeybindingService, @IContextKeyService contextKeyService: IContextKeyService, @ICommandService commandService: ICommandService, @@ -296,71 +419,99 @@ class DelegateStandaloneKeybindingService extends StandaloneKeybindingService { @ILogService logService: ILogService, @ICodeEditorService codeEditorService: ICodeEditorService ) { - super(contextKeyService, commandService, telemetryService, notificationService, logService, codeEditorService) - - this._register(delegate.registerKeybindingProvider({ - provideKeybindings: () => { - return this.getUserKeybindingItems() - }, - onDidChangeKeybindings: this.onDidUpdateKeybindings - })) + super( + contextKeyService, + commandService, + telemetryService, + notificationService, + logService, + codeEditorService + ) + + this._register( + delegate.registerKeybindingProvider({ + provideKeybindings: () => { + return this.getUserKeybindingItems() + }, + onDidChangeKeybindings: this.onDidUpdateKeybindings + }) + ) } - protected override _getResolver (): KeybindingResolver { + protected override _getResolver(): KeybindingResolver { return this.delegate._getResolver() } - override resolveKeyboardEvent (keyboardEvent: IKeyboardEvent): ResolvedKeybinding { + override resolveKeyboardEvent(keyboardEvent: IKeyboardEvent): ResolvedKeybinding { return this.delegate.resolveKeyboardEvent(keyboardEvent) } - override resolveKeybinding (keybinding: Keybinding): ResolvedKeybinding[] { + override resolveKeybinding(keybinding: Keybinding): ResolvedKeybinding[] { return this.delegate.resolveKeybinding(keybinding) } - public override resolveUserBinding (userBinding: string): ResolvedKeybinding[] { + public override resolveUserBinding(userBinding: string): ResolvedKeybinding[] { return this.delegate.resolveUserBinding(userBinding) } - public override _dumpDebugInfo (): string { + public override _dumpDebugInfo(): string { return this.delegate._dumpDebugInfo() } - public override _dumpDebugInfoJSON (): string { + public override _dumpDebugInfoJSON(): string { return this.delegate._dumpDebugInfoJSON() } - public override registerSchemaContribution (contribution: KeybindingsSchemaContribution): void { + public override registerSchemaContribution(contribution: KeybindingsSchemaContribution): void { return this.delegate.registerSchemaContribution(contribution) } - public override enableKeybindingHoldMode (commandId: string): Promise | undefined { + public override enableKeybindingHoldMode(commandId: string): Promise | undefined { return this.delegate.enableKeybindingHoldMode(commandId) } } let standaloneEditorInstantiationService: IInstantiationService | null = null -function getStandaloneEditorInstantiationService (accessor: ServicesAccessor) { +function getStandaloneEditorInstantiationService(accessor: ServicesAccessor) { if (standaloneEditorInstantiationService == null) { const serviceCollection = new ServiceCollection() - serviceCollection.set(IQuickInputService, new SyncDescriptor(StandaloneQuickInputService, [], true)) + serviceCollection.set( + IQuickInputService, + new SyncDescriptor(StandaloneQuickInputService, [], true) + ) const keybindingService = accessor.get(IKeybindingService) - if (!(keybindingService instanceof StandaloneKeybindingService) && isDynamicKeybindingService(keybindingService)) { - serviceCollection.set(IKeybindingService, new SyncDescriptor(DelegateStandaloneKeybindingService, [keybindingService], true)) + if ( + !(keybindingService instanceof StandaloneKeybindingService) && + isDynamicKeybindingService(keybindingService) + ) { + serviceCollection.set( + IKeybindingService, + new SyncDescriptor(DelegateStandaloneKeybindingService, [keybindingService], true) + ) } - standaloneEditorInstantiationService = accessor.get(IInstantiationService).createChild(serviceCollection) + standaloneEditorInstantiationService = accessor + .get(IInstantiationService) + .createChild(serviceCollection) } return standaloneEditorInstantiationService } export const createConfiguredEditor: typeof createEditor = (domElement, options, override) => { const instantiationService = StandaloneServices.initialize(override ?? {}) - return instantiationService.invokeFunction(getStandaloneEditorInstantiationService).createInstance(ConfiguredStandaloneEditor, domElement, options) + return instantiationService + .invokeFunction(getStandaloneEditorInstantiationService) + .createInstance(ConfiguredStandaloneEditor, domElement, options) } -export const createConfiguredDiffEditor: typeof createDiffEditor = (domElement, options, override) => { +export const createConfiguredDiffEditor: typeof createDiffEditor = ( + domElement, + options, + override +) => { const instantiationService = StandaloneServices.initialize(override ?? {}) - return instantiationService.invokeFunction(getStandaloneEditorInstantiationService).createInstance(ConfiguredStandaloneDiffEditor, domElement, options) + return instantiationService + .invokeFunction(getStandaloneEditorInstantiationService) + .createInstance(ConfiguredStandaloneDiffEditor, domElement, options) } const Extensions = { @@ -371,27 +522,20 @@ const Extensions = { export { errorHandler, DisposableStore, - FoldingController, FoldingModel, setCollapseStateForMatchingLines, - Registry, CommandsRegistry, Extensions, IJSONContributionRegistry, IJSONSchema, - MenuRegistry, MenuId, - KeybindingsRegistry, - ContextKeyExpr, RawContextKey, - registerColor, - IReference, ITextFileEditorModel } diff --git a/src/override/vs/workbench/browser/parts/editor/textEditor.js b/src/override/vs/workbench/browser/parts/editor/textEditor.js index 49920614..4318919d 100644 --- a/src/override/vs/workbench/browser/parts/editor/textEditor.js +++ b/src/override/vs/workbench/browser/parts/editor/textEditor.js @@ -2,4 +2,4 @@ export * from 'vscode/src/vs/workbench/browser/parts/editor/textEditor.js' import { AbstractTextEditor } from 'vscode/src/vs/workbench/browser/parts/editor/textEditor.js' import { setAbstractTextEditor } from './textEditor.weak.js' -setAbstractTextEditor(AbstractTextEditor) \ No newline at end of file +setAbstractTextEditor(AbstractTextEditor) diff --git a/src/override/vs/workbench/browser/parts/editor/textEditor.weak.js b/src/override/vs/workbench/browser/parts/editor/textEditor.weak.js index 025a7fd0..9e6160c7 100644 --- a/src/override/vs/workbench/browser/parts/editor/textEditor.weak.js +++ b/src/override/vs/workbench/browser/parts/editor/textEditor.weak.js @@ -6,7 +6,7 @@ let AbstractTextEditor = class {} class FakeAbstractTextEditor { static [Symbol.hasInstance](instance) { - return AbstractTextEditor != null && instance instanceof AbstractTextEditor + return AbstractTextEditor != null && instance instanceof AbstractTextEditor } } @@ -14,4 +14,4 @@ export function setAbstractTextEditor(_AbstractTextEditor) { AbstractTextEditor = _AbstractTextEditor } -export { FakeAbstractTextEditor as AbstractTextEditor } \ No newline at end of file +export { FakeAbstractTextEditor as AbstractTextEditor } diff --git a/src/rollup-extension-directory-plugin.ts b/src/rollup-extension-directory-plugin.ts index c1b41a48..8c459725 100644 --- a/src/rollup-extension-directory-plugin.ts +++ b/src/rollup-extension-directory-plugin.ts @@ -12,22 +12,22 @@ interface Options { transformManifest?: (manifest: IExtensionManifest) => IExtensionManifest } -export default function plugin ({ +export default function plugin({ include, exclude, - transformManifest = manifest => manifest + transformManifest = (manifest) => manifest }: Options): Plugin { const filter = createFilter(include, exclude) return { name: 'default-extensions-loader', - resolveId (source) { + resolveId(source) { if (filter(source)) { return source } return undefined }, - async load (id) { + async load(id) { // load extension directory as a module that loads the extension if (!filter(id)) { return @@ -52,19 +52,35 @@ export default function plugin ({ if (stat.isDirectory()) { // Load the extension directory as a module importing the required files and registering the extension const manifestPath = path.resolve(id, 'package.json') - const manifest = transformManifest(parseJson(id, (await fs.promises.readFile(manifestPath)).toString('utf8'))) + const manifest = transformManifest( + parseJson( + id, + (await fs.promises.readFile(manifestPath)).toString('utf8') + ) + ) try { const resources = await getExtensionResources(manifest, fs, id) - const resourcePaths = resources.map(r => r.path) - const readmePath = resourcePaths.filter(child => /^readme(\.txt|\.md|)$/i.test(child))[0] - const changelogPath = resourcePaths.filter(child => /^changelog(\.txt|\.md|)$/i.test(child))[0] + const resourcePaths = resources.map((r) => r.path) + const readmePath = resourcePaths.filter((child) => + /^readme(\.txt|\.md|)$/i.test(child) + )[0] + const changelogPath = resourcePaths.filter((child) => + /^changelog(\.txt|\.md|)$/i.test(child) + )[0] - function generateFileRegistrationInstruction (filePath: string, importPath: string, mimeType?: string, size?: number) { - return `registerFileUrl('${filePath}', new URL('${importPath}', import.meta.url).toString(), ${JSON.stringify({ - mimeType, - size - })})` + function generateFileRegistrationInstruction( + filePath: string, + importPath: string, + mimeType?: string, + size?: number + ) { + return `registerFileUrl('${filePath}', new URL('${importPath}', import.meta.url).toString(), ${JSON.stringify( + { + mimeType, + size + } + )})` } return ` @@ -72,13 +88,20 @@ import manifest from '${manifestPath}' import { registerExtension } from 'vscode/extensions' const { registerFileUrl, whenReady } = registerExtension(manifest, undefined, ${JSON.stringify({ system: true, readmePath, changelogPath })}) -${resources.map(resource => { - const lines: string[] = resource.extensionPaths.map(extensionPath => - generateFileRegistrationInstruction(extensionPath, path.resolve(id, resource.path), resource.mimeType, resource.size) - ) +${resources + .map((resource) => { + const lines: string[] = resource.extensionPaths.map((extensionPath) => + generateFileRegistrationInstruction( + extensionPath, + path.resolve(id, resource.path), + resource.mimeType, + resource.size + ) + ) - return lines.join('\n') -}).join('\n')} + return lines.join('\n') + }) + .join('\n')} export { whenReady } ` @@ -93,6 +116,4 @@ export { whenReady } } } -export { - IExtensionManifest -} +export { IExtensionManifest } diff --git a/src/rollup-vsix-plugin.ts b/src/rollup-vsix-plugin.ts index fe356e6b..624e8a27 100644 --- a/src/rollup-vsix-plugin.ts +++ b/src/rollup-vsix-plugin.ts @@ -15,7 +15,7 @@ interface Options { transformManifest?: (manifest: IExtensionManifest) => IExtensionManifest } -function read (stream: Readable): Promise { +function read(stream: Readable): Promise { const bufs: Buffer[] = [] return new Promise((resolve) => { stream.on('data', function (d) { @@ -27,7 +27,7 @@ function read (stream: Readable): Promise { }) } -async function readVsix (file: string): Promise { +async function readVsix(file: string): Promise { return await new Promise((resolve) => { const files: Record = {} yauzl.open(file, { lazyEntries: true }, (err, zipfile) => { @@ -53,20 +53,20 @@ async function readVsix (file: string): Promise { }) } -function getVsixPath (file: string) { +function getVsixPath(file: string) { return path.posix.relative('/', path.posix.resolve('/', file)) } -export default function plugin ({ +export default function plugin({ include = '**/*.vsix', exclude, - transformManifest = manifest => manifest + transformManifest = (manifest) => manifest }: Options = {}): Plugin { const filter = createFilter(include, exclude) return { name: 'vsix-loader', - resolveId (source) { + resolveId(source) { if (filter(source)) { return source } @@ -75,40 +75,51 @@ export default function plugin ({ } return undefined }, - async load (id) { + async load(id) { if (!filter(id)) return null const vsixFS = await readVsix(id) - const readFileSync = (filePath: string) => vsixFS.readFileSync(path.join('/', filePath)) as Buffer - const manifest = transformManifest(parseJson(id, readFileSync('package.json').toString('utf8'))) - - const resources = await getExtensionResources(manifest, vsixFS, '/') - - const resourcePaths = resources.map(r => r.path) - const readmePath = resourcePaths.filter(child => /^readme(\.txt|\.md|)$/i.test(child))[0] - const changelogPath = resourcePaths.filter(child => /^changelog(\.txt|\.md|)$/i.test(child))[0] - - const pathMapping = (await Promise.all(resources.map(async resource => { - const assetPath = getVsixPath(resource.path) - let url: string - if (process.env.NODE_ENV === 'development') { - const fileType = resource.mimeType ?? 'text/javascript' - url = `'data:${fileType};base64,${readFileSync(assetPath).toString('base64')}'` - } else { - url = 'import.meta.ROLLUP_FILE_URL_' + this.emitFile({ - type: 'asset', - name: `${path.basename(id)}/${path.basename(assetPath)}`, - source: readFileSync(assetPath) + const readFileSync = (filePath: string) => + vsixFS.readFileSync(path.join('/', filePath)) as Buffer + const manifest = transformManifest( + parseJson(id, readFileSync('package.json').toString('utf8')) + ) + + const resources = await getExtensionResources(manifest, (vsixFS), '/') + + const resourcePaths = resources.map((r) => r.path) + const readmePath = resourcePaths.filter((child) => /^readme(\.txt|\.md|)$/i.test(child))[0] + const changelogPath = resourcePaths.filter((child) => + /^changelog(\.txt|\.md|)$/i.test(child) + )[0] + + const pathMapping = ( + await Promise.all( + resources.map(async (resource) => { + const assetPath = getVsixPath(resource.path) + let url: string + if (process.env.NODE_ENV === 'development') { + const fileType = resource.mimeType ?? 'text/javascript' + url = `'data:${fileType};base64,${readFileSync(assetPath).toString('base64')}'` + } else { + url = + 'import.meta.ROLLUP_FILE_URL_' + + this.emitFile({ + type: 'asset', + name: `${path.basename(id)}/${path.basename(assetPath)}`, + source: readFileSync(assetPath) + }) + } + + return resource.extensionPaths.map((extensionPath) => ({ + pathInExtension: getVsixPath(extensionPath), + url, + mimeType: resource.mimeType, + size: resource.size + })) }) - } - - return resource.extensionPaths.map(extensionPath => ({ - pathInExtension: getVsixPath(extensionPath), - url, - mimeType: resource.mimeType, - size: resource.size - })) - }))).flat() + ) + ).flat() return ` import { registerExtension } from 'vscode/extensions' @@ -117,11 +128,15 @@ const manifest = ${JSON.stringify(manifest)} const { registerFileUrl, whenReady } = registerExtension(manifest, undefined, ${JSON.stringify({ system: true, readmePath, changelogPath })}) -${pathMapping.map(({ pathInExtension, url, mimeType, size }) => (` +${pathMapping + .map( + ({ pathInExtension, url, mimeType, size }) => ` registerFileUrl('${pathInExtension}', ${url}, ${JSON.stringify({ - mimeType, - size -})})`)).join('\n')} + mimeType, + size + })})` + ) + .join('\n')} export { whenReady } ` @@ -129,6 +144,4 @@ export { whenReady } } } -export { - IExtensionManifest -} +export { IExtensionManifest } diff --git a/src/service-override/accessibility.ts b/src/service-override/accessibility.ts index 1126c695..0ba2c6a1 100644 --- a/src/service-override/accessibility.ts +++ b/src/service-override/accessibility.ts @@ -16,11 +16,19 @@ import 'vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignal.co registerAssets(audioAssets) -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IAccessibleViewService.toString()]: new SyncDescriptor(AccessibleViewService, [], true), - [IAccessibilitySignalService.toString()]: new SyncDescriptor(AccessibilitySignalService, [], true), + [IAccessibilitySignalService.toString()]: new SyncDescriptor( + AccessibilitySignalService, + [], + true + ), [IAccessibilityService.toString()]: new SyncDescriptor(AccessibilityService, [], true), - [IAccessibleViewInformationService.toString()]: new SyncDescriptor(AccessibleViewInformationService, [], true) + [IAccessibleViewInformationService.toString()]: new SyncDescriptor( + AccessibleViewInformationService, + [], + true + ) } } diff --git a/src/service-override/ai.ts b/src/service-override/ai.ts index f7c0ada9..73359d53 100644 --- a/src/service-override/ai.ts +++ b/src/service-override/ai.ts @@ -4,9 +4,17 @@ import { IAiEmbeddingVectorService } from 'vs/workbench/services/aiEmbeddingVect import { IAiRelatedInformationService } from 'vs/workbench/services/aiRelatedInformation/common/aiRelatedInformation.service' import { AiRelatedInformationService } from 'vs/workbench/services/aiRelatedInformation/common/aiRelatedInformationService' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { - [IAiRelatedInformationService.toString()]: new SyncDescriptor(AiRelatedInformationService, [], true), - [IAiEmbeddingVectorService.toString()]: new SyncDescriptor(AiRelatedInformationService, [], true) + [IAiRelatedInformationService.toString()]: new SyncDescriptor( + AiRelatedInformationService, + [], + true + ), + [IAiEmbeddingVectorService.toString()]: new SyncDescriptor( + AiRelatedInformationService, + [], + true + ) } } diff --git a/src/service-override/authentication.ts b/src/service-override/authentication.ts index 38ec3c64..aa90ebc5 100644 --- a/src/service-override/authentication.ts +++ b/src/service-override/authentication.ts @@ -1,6 +1,9 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IAuthenticationExtensionsService, IAuthenticationService } from 'vs/workbench/services/authentication/common/authentication.service' +import { + IAuthenticationExtensionsService, + IAuthenticationService +} from 'vs/workbench/services/authentication/common/authentication.service' import { AuthenticationService } from 'vs/workbench/services/authentication/browser/authenticationService' import { AuthenticationAccessService } from 'vs/workbench/services/authentication/browser/authenticationAccessService' import { AuthenticationUsageService } from 'vs/workbench/services/authentication/browser/authenticationUsageService' @@ -8,11 +11,23 @@ import { AuthenticationExtensionsService } from 'vs/workbench/services/authentic import { IAuthenticationAccessService } from 'vs/workbench/services/authentication/browser/authenticationAccessService.service' import { IAuthenticationUsageService } from 'vs/workbench/services/authentication/browser/authenticationUsageService.service' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IAuthenticationService.toString()]: new SyncDescriptor(AuthenticationService, [], true), - [IAuthenticationAccessService.toString()]: new SyncDescriptor(AuthenticationAccessService, [], true), - [IAuthenticationExtensionsService.toString()]: new SyncDescriptor(AuthenticationExtensionsService, [], true), - [IAuthenticationUsageService.toString()]: new SyncDescriptor(AuthenticationUsageService, [], true) + [IAuthenticationAccessService.toString()]: new SyncDescriptor( + AuthenticationAccessService, + [], + true + ), + [IAuthenticationExtensionsService.toString()]: new SyncDescriptor( + AuthenticationExtensionsService, + [], + true + ), + [IAuthenticationUsageService.toString()]: new SyncDescriptor( + AuthenticationUsageService, + [], + true + ) } } diff --git a/src/service-override/base.ts b/src/service-override/base.ts index 126a4196..bbfd08e2 100644 --- a/src/service-override/base.ts +++ b/src/service-override/base.ts @@ -33,7 +33,7 @@ import { WorkbenchEditorWorkerService } from 'vs/workbench/contrib/codeEditor/br import { getEnvironmentOverride } from '../workbench' class BrowserPathServiceOverride extends AbstractPathService { - constructor ( + constructor( @IRemoteAgentService remoteAgentService: IRemoteAgentService, @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, @IWorkspaceContextService contextService: IWorkspaceContextService @@ -47,7 +47,7 @@ class BrowserPathServiceOverride extends AbstractPathService { } } -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IRequestService.toString()]: new SyncDescriptor(BrowserRequestService, [], true), [IDownloadService.toString()]: new SyncDescriptor(DownloadService, [], true), @@ -62,6 +62,5 @@ export default function getServiceOverride (): IEditorOverrideServices { [ITrustedDomainService.toString()]: new SyncDescriptor(TrustedDomainService, [], true), [ILabelService.toString()]: new SyncDescriptor(LabelService, [], true), [IEditorWorkerService.toString()]: new SyncDescriptor(WorkbenchEditorWorkerService, [], true) - } } diff --git a/src/service-override/bulkEdit.ts b/src/service-override/bulkEdit.ts index cd703d14..5eb591c7 100644 --- a/src/service-override/bulkEdit.ts +++ b/src/service-override/bulkEdit.ts @@ -4,7 +4,7 @@ import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService' import { BulkEditService } from 'vs/workbench/contrib/bulkEdit/browser/bulkEditService' import 'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IBulkEditService.toString()]: new SyncDescriptor(BulkEditService, [], true) } diff --git a/src/service-override/chat.ts b/src/service-override/chat.ts index 1ab7cd9e..43205d0a 100644 --- a/src/service-override/chat.ts +++ b/src/service-override/chat.ts @@ -1,13 +1,21 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IChatAccessibilityService, IChatCodeBlockContextProviderService, IChatWidgetService, IQuickChatService } from 'vs/workbench/contrib/chat/browser/chat.service' +import { + IChatAccessibilityService, + IChatCodeBlockContextProviderService, + IChatWidgetService, + IQuickChatService +} from 'vs/workbench/contrib/chat/browser/chat.service' import { ChatAccessibilityService } from 'vs/workbench/contrib/chat/browser/chatAccessibilityService' import { QuickChatService } from 'vs/workbench/contrib/chat/browser/chatQuick' import { ChatVariablesService } from 'vs/workbench/contrib/chat/browser/chatVariables' import { ChatWidgetService } from 'vs/workbench/contrib/chat/browser/chatWidget' import { ChatCodeBlockContextProviderService } from 'vs/workbench/contrib/chat/browser/codeBlockContextProviderService' import { ChatAgentNameService, ChatAgentService } from 'vs/workbench/contrib/chat/common/chatAgents' -import { IChatAgentNameService, IChatAgentService } from 'vs/workbench/contrib/chat/common/chatAgents.service' +import { + IChatAgentNameService, + IChatAgentService +} from 'vs/workbench/contrib/chat/common/chatAgents.service' import { IChatService } from 'vs/workbench/contrib/chat/common/chatService.service' import { ChatService } from 'vs/workbench/contrib/chat/common/chatServiceImpl' import { ChatSlashCommandService } from 'vs/workbench/contrib/chat/common/chatSlashCommands' @@ -31,7 +39,7 @@ import { ICodeMapperService } from 'vs/workbench/contrib/chat/common/chatCodeMap import { CodeMapperService } from 'vs/workbench/contrib/chat/common/chatCodeMapperService' import { IChatEditingService } from 'vs/workbench/contrib/chat/common/chatEditingService.service' import { ChatEditingService } from 'vs/workbench/contrib/chat/browser/chatEditingService' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IChatService.toString()]: new SyncDescriptor(ChatService, [], true), [IChatWidgetService.toString()]: new SyncDescriptor(ChatWidgetService, [], true), @@ -42,12 +50,32 @@ export default function getServiceOverride (): IEditorOverrideServices { [IChatSlashCommandService.toString()]: new SyncDescriptor(ChatSlashCommandService, [], true), [IChatAgentService.toString()]: new SyncDescriptor(ChatAgentService, [], true), [IChatVariablesService.toString()]: new SyncDescriptor(ChatVariablesService, [], true), - [IInlineChatSessionService.toString()]: new SyncDescriptor(InlineChatSessionServiceImpl, [], true), - [IInlineChatSavingService.toString()]: new SyncDescriptor(InlineChatSavingServiceImpl, [], true), - [IChatCodeBlockContextProviderService.toString()]: new SyncDescriptor(ChatCodeBlockContextProviderService, [], true), - [ILanguageModelStatsService.toString()]: new SyncDescriptor(LanguageModelStatsService, [], true), + [IInlineChatSessionService.toString()]: new SyncDescriptor( + InlineChatSessionServiceImpl, + [], + true + ), + [IInlineChatSavingService.toString()]: new SyncDescriptor( + InlineChatSavingServiceImpl, + [], + true + ), + [IChatCodeBlockContextProviderService.toString()]: new SyncDescriptor( + ChatCodeBlockContextProviderService, + [], + true + ), + [ILanguageModelStatsService.toString()]: new SyncDescriptor( + LanguageModelStatsService, + [], + true + ), [IChatAgentNameService.toString()]: new SyncDescriptor(ChatAgentNameService, [], true), - [ILanguageModelToolsService.toString()]: new SyncDescriptor(LanguageModelToolsService, [], true), + [ILanguageModelToolsService.toString()]: new SyncDescriptor( + LanguageModelToolsService, + [], + true + ), [ICodeMapperService.toString()]: new SyncDescriptor(CodeMapperService, [], true), [IChatEditingService.toString()]: new SyncDescriptor(ChatEditingService, [], true) } diff --git a/src/service-override/comments.ts b/src/service-override/comments.ts index af51fa8d..70cc466d 100644 --- a/src/service-override/comments.ts +++ b/src/service-override/comments.ts @@ -4,7 +4,7 @@ import { ICommentService } from 'vs/workbench/contrib/comments/browser/commentSe import { CommentService } from 'vs/workbench/contrib/comments/browser/commentService' import 'vs/workbench/contrib/comments/browser/comments.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ICommentService.toString()]: new SyncDescriptor(CommentService, [], true) } diff --git a/src/service-override/configuration.ts b/src/service-override/configuration.ts index f6d654bb..b2224bb9 100644 --- a/src/service-override/configuration.ts +++ b/src/service-override/configuration.ts @@ -3,11 +3,20 @@ import { IDisposable } from 'vs/base/common/lifecycle' import { Schemas } from 'vs/base/common/network' import { URI } from 'vs/base/common/uri' import { generateUuid } from 'vs/base/common/uuid' -import { ITextResourceConfigurationService, ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfiguration' +import { + ITextResourceConfigurationService, + ITextResourcePropertiesService +} from 'vs/editor/common/services/textResourceConfiguration' import { TextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService' import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { IConfigurationService } from 'vs/platform/configuration/common/configuration.service' -import { Extensions as ConfigurationExtensions, ConfigurationScope, IConfigurationDefaults, IConfigurationNode, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry' +import { + Extensions as ConfigurationExtensions, + ConfigurationScope, + IConfigurationDefaults, + IConfigurationNode, + IConfigurationRegistry +} from 'vs/platform/configuration/common/configurationRegistry' import { IFileWriteOptions } from 'vs/platform/files/common/files' import { IFileService } from 'vs/platform/files/common/files.service' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' @@ -17,9 +26,17 @@ import { IPolicyService } from 'vs/platform/policy/common/policy.service' import { Registry } from 'vs/platform/registry/common/platform' import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity.service' import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile.service' -import { IAnyWorkspaceIdentifier, IEmptyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace' +import { + IAnyWorkspaceIdentifier, + IEmptyWorkspaceIdentifier, + ISingleFolderWorkspaceIdentifier, + IWorkspaceIdentifier +} from 'vs/platform/workspace/common/workspace' import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace.service' -import { IStoredWorkspace, IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces' +import { + IStoredWorkspace, + IWorkspaceFolderCreationData +} from 'vs/platform/workspaces/common/workspaces' import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces.service' import 'vs/workbench/api/common/configurationExtensionPoint' import 'vs/workbench/contrib/workspaces/browser/workspaces.contribution' @@ -29,7 +46,10 @@ import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/envir import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService.service' import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService.service' import { TextResourcePropertiesService } from 'vs/workbench/services/textresourceProperties/common/textResourcePropertiesService' -import { IColorCustomizations, IThemeScopedColorCustomizations } from 'vs/workbench/services/themes/common/workbenchThemeService' +import { + IColorCustomizations, + IThemeScopedColorCustomizations +} from 'vs/workbench/services/themes/common/workbenchThemeService' import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile.service' import { AbstractWorkspaceEditingService } from 'vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService' import { BrowserWorkspacesService } from 'vs/workbench/services/workspaces/browser/workspacesService' @@ -43,34 +63,46 @@ import { memoizedConstructor, unsupported } from '../tools' import { getWorkspaceIdentifier } from '../workbench' // This is the default value, but can be overriden by overriding the Environment or UserDataProfileService service -const defaultUserConfigurationFile = URI.from({ scheme: Schemas.vscodeUserData, path: '/User/settings.json' }) +const defaultUserConfigurationFile = URI.from({ + scheme: Schemas.vscodeUserData, + path: '/User/settings.json' +}) /** * Should be called only BEFORE the service are initialized to initialize the file on the filesystem before the configuration service initializes */ -async function initUserConfiguration (configurationJson: string, options?: Partial, file: URI = defaultUserConfigurationFile): Promise { +async function initUserConfiguration( + configurationJson: string, + options?: Partial, + file: URI = defaultUserConfigurationFile +): Promise { await initFile(file, configurationJson, options) } /** * Can be called at any time after the services are initialized to update the user configuration */ -async function updateUserConfiguration (configurationJson: string): Promise { +async function updateUserConfiguration(configurationJson: string): Promise { const userDataProfilesService = await getService(IUserDataProfilesService) const fileService = await getService(IFileService) - await fileService.writeFile(userDataProfilesService.defaultProfile.settingsResource, VSBuffer.fromString(configurationJson)) + await fileService.writeFile( + userDataProfilesService.defaultProfile.settingsResource, + VSBuffer.fromString(configurationJson) + ) } -async function getUserConfiguration (): Promise { +async function getUserConfiguration(): Promise { const userDataProfilesService = await getService(IUserDataProfilesService) const fileService = await getService(IFileService) - return (await fileService.readFile(userDataProfilesService.defaultProfile.settingsResource)).value.toString() + return ( + await fileService.readFile(userDataProfilesService.defaultProfile.settingsResource) + ).value.toString() } -function onUserConfigurationChange (callback: () => void): IDisposable { - return withReadyServices(accessor => { +function onUserConfigurationChange(callback: () => void): IDisposable { + return withReadyServices((accessor) => { const userDataProfilesService = accessor.get(IUserDataProfilesService) - return accessor.get(IFileService).onDidFilesChange(e => { + return accessor.get(IFileService).onDidFilesChange((e) => { if (e.affects(userDataProfilesService.defaultProfile.settingsResource)) { callback() } @@ -78,10 +110,12 @@ function onUserConfigurationChange (callback: () => void): IDisposable { }) } -const configurationRegistry = Registry.as(ConfigurationExtensions.Configuration) +const configurationRegistry = Registry.as( + ConfigurationExtensions.Configuration +) class InjectedConfigurationService extends WorkspaceService { - constructor ( + constructor( @IWorkbenchEnvironmentService workbenchEnvironmentService: IBrowserWorkbenchEnvironmentService, @IUserDataProfileService userDataProfileService: IUserDataProfileService, @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, @@ -91,8 +125,22 @@ class InjectedConfigurationService extends WorkspaceService { @ILogService logService: ILogService, @IPolicyService policyService: IPolicyService ) { - const configurationCache = new ConfigurationCache([Schemas.file, Schemas.vscodeUserData, Schemas.tmp], workbenchEnvironmentService, fileService) - super({ configurationCache }, workbenchEnvironmentService, userDataProfileService, userDataProfilesService, fileService, remoteAgentService, uriIdentityService, logService, policyService) + const configurationCache = new ConfigurationCache( + [Schemas.file, Schemas.vscodeUserData, Schemas.tmp], + workbenchEnvironmentService, + fileService + ) + super( + { configurationCache }, + workbenchEnvironmentService, + userDataProfileService, + userDataProfilesService, + fileService, + remoteAgentService, + uriIdentityService, + logService, + policyService + ) } } @@ -115,13 +163,18 @@ registerServiceInitializePreParticipant(async (accessor) => { const fileService = accessor.get(IFileService) // Create the directory in the memory filesystem to prevent a warn log await fileService.createFolder(workspace) - await fileService.writeFile(configPath, VSBuffer.fromString(JSON.stringify({ - folders: [ - { - path: workspace.path - } - ] - }))) + await fileService.writeFile( + configPath, + VSBuffer.fromString( + JSON.stringify({ + folders: [ + { + path: workspace.path + } + ] + }) + ) + ) } catch (err) { // ignore } @@ -137,34 +190,78 @@ registerServiceInitializePreParticipant(async (accessor) => { const MemoizedInjectedConfigurationService = memoizedConstructor(InjectedConfigurationService) -export async function reinitializeWorkspace (workspace: IAnyWorkspaceIdentifier): Promise { - const workspaceService = await getService(IWorkspaceContextService) as WorkspaceService +export async function reinitializeWorkspace(workspace: IAnyWorkspaceIdentifier): Promise { + const workspaceService = (await getService(IWorkspaceContextService)) as WorkspaceService await workspaceService.initialize(workspace) } -function getServiceOverride (): IEditorOverrideServices +function getServiceOverride(): IEditorOverrideServices /** * @deprecated Provide workspace via the services `initialize` function `configuration.workspaceProvider` parameter */ -function getServiceOverride (defaultWorkspace?: URI | IAnyWorkspaceIdentifier): IEditorOverrideServices +function getServiceOverride( + defaultWorkspace?: URI | IAnyWorkspaceIdentifier +): IEditorOverrideServices -function getServiceOverride (defaultWorkspace?: URI | IAnyWorkspaceIdentifier): IEditorOverrideServices { +function getServiceOverride( + defaultWorkspace?: URI | IAnyWorkspaceIdentifier +): IEditorOverrideServices { _defaultWorkspace = defaultWorkspace return { ...getFileServiceOverride(), - [IConfigurationService.toString()]: new SyncDescriptor(MemoizedInjectedConfigurationService, [], true), - [IWorkspaceContextService.toString()]: new SyncDescriptor(MemoizedInjectedConfigurationService, [], true), - [ITextResourceConfigurationService.toString()]: new SyncDescriptor(TextResourceConfigurationService, [], true), - [IWorkspaceEditingService.toString()]: new SyncDescriptor(MonacoWorkspaceEditingService, [], true), + [IConfigurationService.toString()]: new SyncDescriptor( + MemoizedInjectedConfigurationService, + [], + true + ), + [IWorkspaceContextService.toString()]: new SyncDescriptor( + MemoizedInjectedConfigurationService, + [], + true + ), + [ITextResourceConfigurationService.toString()]: new SyncDescriptor( + TextResourceConfigurationService, + [], + true + ), + [IWorkspaceEditingService.toString()]: new SyncDescriptor( + MonacoWorkspaceEditingService, + [], + true + ), [IWorkspacesService.toString()]: new SyncDescriptor(BrowserWorkspacesService, [], true), - [ITextResourcePropertiesService.toString()]: new SyncDescriptor(TextResourcePropertiesService, [], true), - [IConfigurationResolverService.toString()]: new SyncDescriptor(ConfigurationResolverService, [], true) + [ITextResourcePropertiesService.toString()]: new SyncDescriptor( + TextResourcePropertiesService, + [], + true + ), + [IConfigurationResolverService.toString()]: new SyncDescriptor( + ConfigurationResolverService, + [], + true + ) } } export default getServiceOverride export { - ConfigurationScope, IAnyWorkspaceIdentifier, IColorCustomizations, IConfigurationDefaults, IConfigurationNode, IEmptyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IStoredWorkspace, IThemeScopedColorCustomizations, IWorkspaceFolderCreationData, IWorkspaceIdentifier, configurationRegistry, defaultUserConfigurationFile, getUserConfiguration, initUserConfiguration, onUserConfigurationChange, updateUserConfiguration + ConfigurationScope, + IAnyWorkspaceIdentifier, + IColorCustomizations, + IConfigurationDefaults, + IConfigurationNode, + IEmptyWorkspaceIdentifier, + ISingleFolderWorkspaceIdentifier, + IStoredWorkspace, + IThemeScopedColorCustomizations, + IWorkspaceFolderCreationData, + IWorkspaceIdentifier, + configurationRegistry, + defaultUserConfigurationFile, + getUserConfiguration, + initUserConfiguration, + onUserConfigurationChange, + updateUserConfiguration } diff --git a/src/service-override/debug.ts b/src/service-override/debug.ts index 07984a74..60fecb94 100644 --- a/src/service-override/debug.ts +++ b/src/service-override/debug.ts @@ -17,15 +17,22 @@ import 'vs/workbench/contrib/debug/browser/debug.contribution' // eslint-disable-next-line dot-notation const original = DebugService.prototype['showError'] // eslint-disable-next-line dot-notation -DebugService.prototype['showError'] = function (message: string, errorActions?: ReadonlyArray) { +DebugService.prototype['showError'] = function ( + message: string, + errorActions?: ReadonlyArray +) { return original.call(this, message, errorActions, false) } -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ILanguageFeaturesService.toString()]: new SyncDescriptor(LanguageFeaturesService, [], true), // To restore inlineValuesProvider [IDebugService.toString()]: new SyncDescriptor(DebugService, [], true), - [IExtensionHostDebugService.toString()]: new SyncDescriptor(BrowserExtensionHostDebugService, [], true), + [IExtensionHostDebugService.toString()]: new SyncDescriptor( + BrowserExtensionHostDebugService, + [], + true + ), [IDebugVisualizerService.toString()]: new SyncDescriptor(DebugVisualizerService, [], true) } } diff --git a/src/service-override/dialogs.ts b/src/service-override/dialogs.ts index c0c2e1b0..4db11250 100644 --- a/src/service-override/dialogs.ts +++ b/src/service-override/dialogs.ts @@ -8,18 +8,20 @@ import { HTMLFileSystemProvider } from 'vs/platform/files/browser/htmlFileSystem import 'vs/workbench/browser/parts/dialogs/dialog.web.contribution' import 'vs/workbench/contrib/welcomeDialog/browser/welcomeDialog.contribution' -function isHTMLFileSystemProvider (provider: IFileSystemProvider): provider is HTMLFileSystemProvider { +function isHTMLFileSystemProvider( + provider: IFileSystemProvider +): provider is HTMLFileSystemProvider { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition return (provider as HTMLFileSystemProvider).directories != null } class DialogServiceOverride extends FileDialogService { - protected override shouldUseSimplified (scheme: string): boolean { + protected override shouldUseSimplified(scheme: string): boolean { return !isHTMLFileSystemProvider(super.fileSystemProvider) || super.shouldUseSimplified(scheme) } } -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IDialogService.toString()]: new SyncDescriptor(DialogService, undefined, true), [IFileDialogService.toString()]: new SyncDescriptor(DialogServiceOverride, undefined, true) diff --git a/src/service-override/editSessions.ts b/src/service-override/editSessions.ts index d8704de4..91901e8d 100644 --- a/src/service-override/editSessions.ts +++ b/src/service-override/editSessions.ts @@ -1,7 +1,10 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { EditSessionsLogService } from 'vs/workbench/contrib/editSessions/common/editSessionsLogService' -import { IEditSessionsLogService, IEditSessionsStorageService } from 'vs/workbench/contrib/editSessions/common/editSessions.service' +import { + IEditSessionsLogService, + IEditSessionsStorageService +} from 'vs/workbench/contrib/editSessions/common/editSessions.service' import { EditSessionsWorkbenchService } from 'vs/workbench/contrib/editSessions/browser/editSessionsStorageService' import { WorkspaceIdentityService } from 'vs/workbench/services/workspaces/common/workspaceIdentityService' import { IWorkspaceIdentityService } from 'vs/workbench/services/workspaces/common/workspaceIdentityService.service' @@ -9,11 +12,19 @@ import { IEditSessionIdentityService } from 'vs/platform/workspace/common/editSe import { EditSessionIdentityService } from 'vs/workbench/services/workspaces/common/editSessionIdentityService' import 'vs/workbench/contrib/editSessions/browser/editSessions.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IEditSessionsLogService.toString()]: new SyncDescriptor(EditSessionsLogService, [], false), - [IEditSessionsStorageService.toString()]: new SyncDescriptor(EditSessionsWorkbenchService, [], false), + [IEditSessionsStorageService.toString()]: new SyncDescriptor( + EditSessionsWorkbenchService, + [], + false + ), [IWorkspaceIdentityService.toString()]: new SyncDescriptor(WorkspaceIdentityService, [], false), - [IEditSessionIdentityService.toString()]: new SyncDescriptor(EditSessionIdentityService, [], false) + [IEditSessionIdentityService.toString()]: new SyncDescriptor( + EditSessionIdentityService, + [], + false + ) } } diff --git a/src/service-override/editor.ts b/src/service-override/editor.ts index 1c047095..b17efa5b 100644 --- a/src/service-override/editor.ts +++ b/src/service-override/editor.ts @@ -9,12 +9,20 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { IReference } from 'vs/base/common/lifecycle' import { TextEditorService } from 'vs/workbench/services/textfile/common/textEditorService' import { ITextEditorService } from 'vs/workbench/services/textfile/common/textEditorService.service' -import { GroupOrientation, IEditorPart } from 'vs/workbench/services/editor/common/editorGroupsService' +import { + GroupOrientation, + IEditorPart +} from 'vs/workbench/services/editor/common/editorGroupsService' import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' import { DEFAULT_EDITOR_PART_OPTIONS } from 'vs/workbench/browser/parts/editor/editor' import { mainWindow } from 'vs/base/browser/window' -import { MonacoDelegateEditorGroupsService, MonacoEditorService, OpenEditor, fakeActiveGroup } from './tools/editor' +import { + MonacoDelegateEditorGroupsService, + MonacoEditorService, + OpenEditor, + fakeActiveGroup +} from './tools/editor' import { unsupported } from '../tools' import 'vs/workbench/browser/parts/editor/editor.contribution._autosave.js' import 'vs/workbench/contrib/files/browser/files.contribution._fileEditorFactory.js' @@ -26,7 +34,10 @@ class EmptyEditorPart implements IEditorPart { windowId = mainWindow.vscodeWindowId onDidLayout = Event.None onDidScroll = Event.None - get contentDimension (): never { return unsupported() } + get contentDimension(): never { + return unsupported() + } + isReady = true whenReady = Promise.resolve() whenRestored = Promise.resolve() @@ -43,7 +54,10 @@ class EmptyEditorPart implements IEditorPart { onDidChangeGroupLocked = Event.None onDidChangeGroupMaximized = Event.None activeGroup = fakeActiveGroup - get sideGroup (): never { return unsupported() } + get sideGroup(): never { + return unsupported() + } + groups = [fakeActiveGroup] count = 0 orientation = GroupOrientation.HORIZONTAL @@ -103,9 +117,15 @@ class EmptyEditorGroupsService implements IEditorGroupsService { onDidScroll = Event.None onDidChangeGroupIndex = Event.None onDidChangeGroupLocked = Event.None - get contentDimension (): never { return unsupported() } + get contentDimension(): never { + return unsupported() + } + activeGroup = fakeActiveGroup - get sideGroup (): never { return unsupported() } + get sideGroup(): never { + return unsupported() + } + groups = [fakeActiveGroup] count = 0 orientation = GroupOrientation.HORIZONTAL @@ -135,28 +155,22 @@ class EmptyEditorGroupsService implements IEditorGroupsService { } class MonacoEditorGroupsService extends MonacoDelegateEditorGroupsService { - constructor (@IInstantiationService instantiationService: IInstantiationService) { - super( - instantiationService.createInstance(EmptyEditorGroupsService), - true, - instantiationService - ) + constructor(@IInstantiationService instantiationService: IInstantiationService) { + super(instantiationService.createInstance(EmptyEditorGroupsService), true, instantiationService) } } -export default function getServiceOverride (openEditor: OpenEditor): IEditorOverrideServices { +export default function getServiceOverride(openEditor: OpenEditor): IEditorOverrideServices { return { [ICodeEditorService.toString()]: new SyncDescriptor(CodeEditorService, undefined, true), - [IEditorService.toString()]: new SyncDescriptor(MonacoEditorService, [openEditor, () => false], true), + [IEditorService.toString()]: new SyncDescriptor( + MonacoEditorService, + [openEditor, () => false], + true + ), [ITextEditorService.toString()]: new SyncDescriptor(TextEditorService, [], false), [IEditorGroupsService.toString()]: new SyncDescriptor(MonacoEditorGroupsService) } } -export { - OpenEditor, - IEditorOptions, - IResolvedTextEditorModel, - IReference, - MonacoEditorService -} +export { OpenEditor, IEditorOptions, IResolvedTextEditorModel, IReference, MonacoEditorService } diff --git a/src/service-override/emmet.ts b/src/service-override/emmet.ts index 2d16d372..3378a809 100644 --- a/src/service-override/emmet.ts +++ b/src/service-override/emmet.ts @@ -1,7 +1,6 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import 'vs/workbench/contrib/emmet/browser/emmet.contribution' -export default function getServiceOverride (): IEditorOverrideServices { - return { - } +export default function getServiceOverride(): IEditorOverrideServices { + return {} } diff --git a/src/service-override/environment.ts b/src/service-override/environment.ts index c6b23938..bcf019c3 100644 --- a/src/service-override/environment.ts +++ b/src/service-override/environment.ts @@ -7,8 +7,15 @@ import { IProductService } from 'vs/platform/product/common/productService.servi import { IWorkbenchConstructionOptions } from 'vs/workbench/browser/web.api' import { getWorkbenchConstructionOptions, getWorkspaceIdentifier, logsPath } from '../workbench' -class InjectedBrowserWorkbenchEnvironmentService extends BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService { - constructor (workspaceId: string = getWorkspaceIdentifier().id, options: IWorkbenchConstructionOptions = getWorkbenchConstructionOptions(), @IProductService productService: IProductService) { +class InjectedBrowserWorkbenchEnvironmentService + extends BrowserWorkbenchEnvironmentService + implements IBrowserWorkbenchEnvironmentService +{ + constructor( + workspaceId: string = getWorkspaceIdentifier().id, + options: IWorkbenchConstructionOptions = getWorkbenchConstructionOptions(), + @IProductService productService: IProductService + ) { super(workspaceId, logsPath, options, productService) } } @@ -16,17 +23,19 @@ class InjectedBrowserWorkbenchEnvironmentService extends BrowserWorkbenchEnviron /** * @deprecated Provide construction option via the services `initialize` function `configuration` parameter */ -function getServiceOverride (options: IWorkbenchConstructionOptions): IEditorOverrideServices -function getServiceOverride (): IEditorOverrideServices +function getServiceOverride(options: IWorkbenchConstructionOptions): IEditorOverrideServices +function getServiceOverride(): IEditorOverrideServices -function getServiceOverride (options?: IWorkbenchConstructionOptions): IEditorOverrideServices { +function getServiceOverride(options?: IWorkbenchConstructionOptions): IEditorOverrideServices { return { - [IEnvironmentService.toString()]: new SyncDescriptor(InjectedBrowserWorkbenchEnvironmentService, [undefined, options], true) + [IEnvironmentService.toString()]: new SyncDescriptor( + InjectedBrowserWorkbenchEnvironmentService, + [undefined, options], + true + ) } } export default getServiceOverride -export { - IWorkbenchConstructionOptions -} +export { IWorkbenchConstructionOptions } diff --git a/src/service-override/explorer.ts b/src/service-override/explorer.ts index e5809599..22910296 100644 --- a/src/service-override/explorer.ts +++ b/src/service-override/explorer.ts @@ -6,7 +6,7 @@ import 'vs/workbench/contrib/files/browser/fileCommands' import 'vs/workbench/contrib/files/browser/fileActions.contribution' import 'vs/workbench/contrib/files/browser/files.contribution._explorer.js' -function getServiceOverride (): IEditorOverrideServices { +function getServiceOverride(): IEditorOverrideServices { return { [IExplorerService.toString()]: new SyncDescriptor(ExplorerService, [], true) } diff --git a/src/service-override/extensionGallery.ts b/src/service-override/extensionGallery.ts index c7c135af..59aeb4a6 100644 --- a/src/service-override/extensionGallery.ts +++ b/src/service-override/extensionGallery.ts @@ -1,15 +1,27 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IExtensionGalleryService, IExtensionTipsService, IGlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement.service' +import { + IExtensionGalleryService, + IExtensionTipsService, + IGlobalExtensionEnablementService +} from 'vs/platform/extensionManagement/common/extensionManagement.service' import { ExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionGalleryService' import { GlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService' import { IExtension as IContribExtension } from 'vs/workbench/contrib/extensions/common/extensions' import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions.service' import { getLocale } from 'vs/platform/languagePacks/common/languagePacks' import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService' -import { IExtensionManagementServerService, IWebExtensionsScannerService, IWorkbenchExtensionEnablementService, IWorkbenchExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement.service' +import { + IExtensionManagementServerService, + IWebExtensionsScannerService, + IWorkbenchExtensionEnablementService, + IWorkbenchExtensionManagementService +} from 'vs/workbench/services/extensionManagement/common/extensionManagement.service' import { ExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagementServerService' -import { IExtensionIgnoredRecommendationsService, IExtensionRecommendationsService } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations.service' +import { + IExtensionIgnoredRecommendationsService, + IExtensionRecommendationsService +} from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations.service' import { ExtensionRecommendationsService } from 'vs/workbench/contrib/extensions/browser/extensionRecommendationsService' import { WebExtensionsScannerService } from 'vs/workbench/services/extensionManagement/browser/webExtensionsScannerService' import { IExtensionRecommendationNotificationService } from 'vs/platform/extensionRecommendations/common/extensionRecommendations.service' @@ -48,9 +60,18 @@ import { unsupported } from '../tools' // plugin-import-meta-asset only allows relative paths registerAssets({ - 'vs/workbench/services/extensionManagement/common/media/defaultIcon.png': new URL('../../vscode/src/vs/workbench/services/extensionManagement/common/media/defaultIcon.png', import.meta.url).toString(), - 'vs/workbench/contrib/extensions/browser/media/theme-icon.png': new URL('../../vscode/src/vs/workbench/contrib/extensions/browser/media/theme-icon.png', import.meta.url).href, - 'vs/workbench/contrib/extensions/browser/media/language-icon.svg': new URL('../../vscode/src/vs/workbench/contrib/extensions/browser/media/theme-icon.png', import.meta.url).href + 'vs/workbench/services/extensionManagement/common/media/defaultIcon.png': new URL( + '../../vscode/src/vs/workbench/services/extensionManagement/common/media/defaultIcon.png', + import.meta.url + ).toString(), + 'vs/workbench/contrib/extensions/browser/media/theme-icon.png': new URL( + '../../vscode/src/vs/workbench/contrib/extensions/browser/media/theme-icon.png', + import.meta.url + ).href, + 'vs/workbench/contrib/extensions/browser/media/language-icon.svg': new URL( + '../../vscode/src/vs/workbench/contrib/extensions/browser/media/theme-icon.png', + import.meta.url + ).href }) class EmptyRemoteAgentService implements IRemoteAgentService { @@ -71,26 +92,30 @@ class EmptyRemoteAgentService implements IRemoteAgentService { } class ExtensionManagementServerServiceOverride extends ExtensionManagementServerService { - constructor ( + constructor( isWebOnly: boolean, @IRemoteAgentService readonly remoteAgentService: IRemoteAgentService, @ILabelService readonly labelService: ILabelService, @IInstantiationService readonly instantiationService: IInstantiationService ) { - super(isWebOnly ? new EmptyRemoteAgentService() : remoteAgentService, labelService, instantiationService) + super( + isWebOnly ? new EmptyRemoteAgentService() : remoteAgentService, + labelService, + instantiationService + ) } } class CustomBuiltinExtensionsScannerService implements IBuiltinExtensionsScannerService { _serviceBrand: undefined - async scanBuiltinExtensions (): Promise { + async scanBuiltinExtensions(): Promise { return getExtensionManifests() } } class ExtensionsWorkbenchServiceOverride extends ExtensionsWorkbenchService { - override canSetLanguage (extension: IContribExtension): boolean { + override canSetLanguage(extension: IContribExtension): boolean { if (super.canSetLanguage(extension)) { const locale = getLocale(extension.gallery!)! return isLocaleAvailable(locale) @@ -107,27 +132,93 @@ export interface ExtensionGalleryOptions { webOnly: boolean } -export default function getServiceOverride (options: ExtensionGalleryOptions = { webOnly: false }): IEditorOverrideServices { +export default function getServiceOverride( + options: ExtensionGalleryOptions = { webOnly: false } +): IEditorOverrideServices { return { [IExtensionGalleryService.toString()]: new SyncDescriptor(ExtensionGalleryService, [], true), - [IGlobalExtensionEnablementService.toString()]: new SyncDescriptor(GlobalExtensionEnablementService, [], true), - [IExtensionsWorkbenchService.toString()]: new SyncDescriptor(ExtensionsWorkbenchServiceOverride, [], true), - [IExtensionManagementServerService.toString()]: new SyncDescriptor(ExtensionManagementServerServiceOverride, [options.webOnly], true), - [IExtensionRecommendationsService.toString()]: new SyncDescriptor(ExtensionRecommendationsService, [], true), - [IExtensionRecommendationNotificationService.toString()]: new SyncDescriptor(ExtensionRecommendationNotificationService, [], true), - [IWebExtensionsScannerService.toString()]: new SyncDescriptor(WebExtensionsScannerService, [], true), - [IExtensionIgnoredRecommendationsService.toString()]: new SyncDescriptor(ExtensionIgnoredRecommendationsService, [], true), - [IIgnoredExtensionsManagementService.toString()]: new SyncDescriptor(IgnoredExtensionsManagementService, [], true), - [IExtensionManifestPropertiesService.toString()]: new SyncDescriptor(ExtensionManifestPropertiesService, [], true), - [IWorkbenchExtensionManagementService.toString()]: new SyncDescriptor(ExtensionManagementService, [], true), - [IBuiltinExtensionsScannerService.toString()]: new SyncDescriptor(CustomBuiltinExtensionsScannerService, [], true), - [IWorkspaceExtensionsConfigService.toString()]: new SyncDescriptor(WorkspaceExtensionsConfigService, [], true), + [IGlobalExtensionEnablementService.toString()]: new SyncDescriptor( + GlobalExtensionEnablementService, + [], + true + ), + [IExtensionsWorkbenchService.toString()]: new SyncDescriptor( + ExtensionsWorkbenchServiceOverride, + [], + true + ), + [IExtensionManagementServerService.toString()]: new SyncDescriptor( + ExtensionManagementServerServiceOverride, + [options.webOnly], + true + ), + [IExtensionRecommendationsService.toString()]: new SyncDescriptor( + ExtensionRecommendationsService, + [], + true + ), + [IExtensionRecommendationNotificationService.toString()]: new SyncDescriptor( + ExtensionRecommendationNotificationService, + [], + true + ), + [IWebExtensionsScannerService.toString()]: new SyncDescriptor( + WebExtensionsScannerService, + [], + true + ), + [IExtensionIgnoredRecommendationsService.toString()]: new SyncDescriptor( + ExtensionIgnoredRecommendationsService, + [], + true + ), + [IIgnoredExtensionsManagementService.toString()]: new SyncDescriptor( + IgnoredExtensionsManagementService, + [], + true + ), + [IExtensionManifestPropertiesService.toString()]: new SyncDescriptor( + ExtensionManifestPropertiesService, + [], + true + ), + [IWorkbenchExtensionManagementService.toString()]: new SyncDescriptor( + ExtensionManagementService, + [], + true + ), + [IBuiltinExtensionsScannerService.toString()]: new SyncDescriptor( + CustomBuiltinExtensionsScannerService, + [], + true + ), + [IWorkspaceExtensionsConfigService.toString()]: new SyncDescriptor( + WorkspaceExtensionsConfigService, + [], + true + ), [IExtensionTipsService.toString()]: new SyncDescriptor(ExtensionTipsService, [], true), - [IRemoteUserDataProfilesService.toString()]: new SyncDescriptor(RemoteUserDataProfilesService, [], true), - [IWorkbenchExtensionEnablementService.toString()]: new SyncDescriptor(ExtensionEnablementService, [], true), + [IRemoteUserDataProfilesService.toString()]: new SyncDescriptor( + RemoteUserDataProfilesService, + [], + true + ), + [IWorkbenchExtensionEnablementService.toString()]: new SyncDescriptor( + ExtensionEnablementService, + [], + true + ), [IExtensionUrlHandler.toString()]: new SyncDescriptor(ExtensionUrlHandler, [], true), - [IExtensionFeaturesManagementService.toString()]: new SyncDescriptor(ExtensionFeaturesManagementService, [], true), + [IExtensionFeaturesManagementService.toString()]: new SyncDescriptor( + ExtensionFeaturesManagementService, + [], + true + ), [IExtensionsScannerService.toString()]: new SyncDescriptor(ExtensionsScannerService, [], true), - [IExtensionsProfileScannerService.toString()]: new SyncDescriptor(ExtensionsProfileScannerService, [], true) + [IExtensionsProfileScannerService.toString()]: new SyncDescriptor( + ExtensionsProfileScannerService, + [], + true + ) } } diff --git a/src/service-override/extensions.ts b/src/service-override/extensions.ts index 6c7f0418..5b42b519 100644 --- a/src/service-override/extensions.ts +++ b/src/service-override/extensions.ts @@ -1,9 +1,16 @@ import { IFileService } from 'vs/platform/files/common/files.service' import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle.service' -import { ExtensionHostStartup, IExtensionHost } from 'vs/workbench/services/extensions/common/extensions' +import { + ExtensionHostStartup, + IExtensionHost +} from 'vs/workbench/services/extensions/common/extensions' import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions.service' import { ILogService } from 'vs/platform/log/common/log.service' -import { ExtensionIdentifier, IExtension, IExtensionDescription } from 'vs/platform/extensions/common/extensions' +import { + ExtensionIdentifier, + IExtension, + IExtensionDescription +} from 'vs/platform/extensions/common/extensions' import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace.service' import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' import { INotificationService } from 'vs/platform/notification/common/notification.service' @@ -13,7 +20,11 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs.service' import { IRemoteAuthorityResolverService } from 'vs/platform/remote/common/remoteAuthorityResolver.service' import { IRemoteExtensionsScannerService } from 'vs/platform/remote/common/remoteExtensionsScanner.service' import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService.service' -import { IWebExtensionsScannerService, IWorkbenchExtensionEnablementService, IWorkbenchExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagement.service' +import { + IWebExtensionsScannerService, + IWorkbenchExtensionEnablementService, + IWorkbenchExtensionManagementService +} from 'vs/workbench/services/extensionManagement/common/extensionManagement.service' import { ExtensionManifestPropertiesService } from 'vs/workbench/services/extensions/common/extensionManifestPropertiesService' import { IExtensionManifestPropertiesService } from 'vs/workbench/services/extensions/common/extensionManifestPropertiesService.service' import { IConfigurationService } from 'vs/platform/configuration/common/configuration.service' @@ -23,8 +34,15 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standalone import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { IUserDataInitializationService } from 'vs/workbench/services/userData/browser/userDataInit.service' import { ExtensionsProposedApi } from 'vs/workbench/services/extensions/common/extensionsProposedApi' -import { BrowserExtensionHostFactory, BrowserExtensionHostKindPicker, ExtensionService } from 'vs/workbench/services/extensions/browser/extensionService' -import { ExtensionHostKind, ExtensionRunningPreference } from 'vs/workbench/services/extensions/common/extensionHostKind' +import { + BrowserExtensionHostFactory, + BrowserExtensionHostKindPicker, + ExtensionService +} from 'vs/workbench/services/extensions/browser/extensionService' +import { + ExtensionHostKind, + ExtensionRunningPreference +} from 'vs/workbench/services/extensions/common/extensionHostKind' import { ExtensionRunningLocation } from 'vs/workbench/services/extensions/common/extensionRunningLocation' import { ExtensionRunningLocationTracker } from 'vs/workbench/services/extensions/common/extensionRunningLocationTracker' import { URI } from 'vs/base/common/uri' @@ -50,44 +68,75 @@ export interface WorkerConfig { options?: WorkerOptions } -let localExtensionHost: (typeof LocalExtensionHost) | undefined -function setLocalExtensionHost (_localExtensionHost: typeof LocalExtensionHost): void { +let localExtensionHost: typeof LocalExtensionHost | undefined +function setLocalExtensionHost(_localExtensionHost: typeof LocalExtensionHost): void { localExtensionHost = _localExtensionHost } class BrowserExtensionHostFactoryOverride extends BrowserExtensionHostFactory { - constructor ( + constructor( private readonly workerExtHostEnabled: boolean, _extensionsProposedApi: ExtensionsProposedApi, _scanWebExtensions: () => Promise, _getExtensionRegistrySnapshotWhenReady: () => Promise, @IInstantiationService _instantiationService: IInstantiationService, @IRemoteAgentService _remoteAgentService: IRemoteAgentService, - @IRemoteAuthorityResolverService _remoteAuthorityResolverService: IRemoteAuthorityResolverService, - @IWorkbenchExtensionEnablementService _extensionEnablementService: IWorkbenchExtensionEnablementService, + @IRemoteAuthorityResolverService + _remoteAuthorityResolverService: IRemoteAuthorityResolverService, + @IWorkbenchExtensionEnablementService + _extensionEnablementService: IWorkbenchExtensionEnablementService, @ILogService _logService: ILogService ) { - super(_extensionsProposedApi, _scanWebExtensions, _getExtensionRegistrySnapshotWhenReady, _instantiationService, _remoteAgentService, _remoteAuthorityResolverService, _extensionEnablementService, _logService) + super( + _extensionsProposedApi, + _scanWebExtensions, + _getExtensionRegistrySnapshotWhenReady, + _instantiationService, + _remoteAgentService, + _remoteAuthorityResolverService, + _extensionEnablementService, + _logService + ) } - override createExtensionHost (runningLocations: ExtensionRunningLocationTracker, runningLocation: ExtensionRunningLocation, isInitialStart: boolean): IExtensionHost | null { + override createExtensionHost( + runningLocations: ExtensionRunningLocationTracker, + runningLocation: ExtensionRunningLocation, + isInitialStart: boolean + ): IExtensionHost | null { switch (runningLocation.kind) { case ExtensionHostKind.LocalProcess: { if (localExtensionHost == null) { return null } - return this._instantiationService.createInstance(localExtensionHost, runningLocation, ExtensionHostStartup.EagerAutoStart, this._createLocalExtensionHostDataProvider(runningLocations, runningLocation, isInitialStart)) + return this._instantiationService.createInstance( + localExtensionHost, + runningLocation, + ExtensionHostStartup.EagerAutoStart, + this._createLocalExtensionHostDataProvider( + runningLocations, + runningLocation, + isInitialStart + ) + ) } case ExtensionHostKind.LocalWebWorker: { if (!this.workerExtHostEnabled) { return null } - const startup = ( - isInitialStart - ? ExtensionHostStartup.EagerManualStart - : ExtensionHostStartup.EagerAutoStart + const startup = isInitialStart + ? ExtensionHostStartup.EagerManualStart + : ExtensionHostStartup.EagerAutoStart + return this._instantiationService.createInstance( + WebWorkerExtensionHost, + runningLocation, + startup, + this._createLocalExtensionHostDataProvider( + runningLocations, + runningLocation, + isInitialStart + ) ) - return this._instantiationService.createInstance(WebWorkerExtensionHost, runningLocation, startup, this._createLocalExtensionHostDataProvider(runningLocations, runningLocation, isInitialStart)) } case ExtensionHostKind.Remote: { return super.createExtensionHost(runningLocations, runningLocation, isInitialStart) @@ -97,19 +146,31 @@ class BrowserExtensionHostFactoryOverride extends BrowserExtensionHostFactory { } class LocalBrowserExtensionHostKindPicker extends BrowserExtensionHostKindPicker { - constructor ( + constructor( private readonly allowedExtHostKinds: ExtensionHostKind[], @ILogService _logService: ILogService ) { super(_logService) } - public override pickExtensionHostKind (extensionId: ExtensionIdentifier, extensionKinds: ExtensionKind[], isInstalledLocally: boolean, isInstalledRemotely: boolean, preference: ExtensionRunningPreference): ExtensionHostKind | null { + public override pickExtensionHostKind( + extensionId: ExtensionIdentifier, + extensionKinds: ExtensionKind[], + isInstalledLocally: boolean, + isInstalledRemotely: boolean, + preference: ExtensionRunningPreference + ): ExtensionHostKind | null { const forcedKind = getForcedExtensionHostKind(extensionId.value) if (forcedKind != null) { return forcedKind } - const detectedKind = super.pickExtensionHostKind(extensionId, extensionKinds, isInstalledLocally, isInstalledRemotely, preference) + const detectedKind = super.pickExtensionHostKind( + extensionId, + extensionKinds, + isInstalledLocally, + isInstalledRemotely, + preference + ) if (detectedKind != null && !this.allowedExtHostKinds.includes(detectedKind)) { return this.allowedExtHostKinds[0] ?? null } @@ -122,28 +183,35 @@ export interface IExtensionWithExtHostKind extends IExtension { } export class ExtensionServiceOverride extends ExtensionService implements IExtensionService { - constructor ( + constructor( workerExtHostEnabled: boolean, @IInstantiationService instantiationService: IInstantiationService, @INotificationService notificationService: INotificationService, - @IBrowserWorkbenchEnvironmentService browserEnvironmentService: IBrowserWorkbenchEnvironmentService, + @IBrowserWorkbenchEnvironmentService + browserEnvironmentService: IBrowserWorkbenchEnvironmentService, @ITelemetryService telemetryService: ITelemetryService, - @IWorkbenchExtensionEnablementService extensionEnablementService: IWorkbenchExtensionEnablementService, + @IWorkbenchExtensionEnablementService + extensionEnablementService: IWorkbenchExtensionEnablementService, @IFileService fileService: IFileService, @IProductService productService: IProductService, - @IWorkbenchExtensionManagementService extensionManagementService: IWorkbenchExtensionManagementService, + @IWorkbenchExtensionManagementService + extensionManagementService: IWorkbenchExtensionManagementService, @IWorkspaceContextService contextService: IWorkspaceContextService, @IConfigurationService configurationService: IConfigurationService, - @IExtensionManifestPropertiesService extensionManifestPropertiesService: IExtensionManifestPropertiesService, + @IExtensionManifestPropertiesService + extensionManifestPropertiesService: IExtensionManifestPropertiesService, @IWebExtensionsScannerService webExtensionsScannerService: IWebExtensionsScannerService, @ILogService logService: ILogService, @IRemoteAgentService remoteAgentService: IRemoteAgentService, - @IRemoteExtensionsScannerService remoteExtensionsScannerService: IRemoteExtensionsScannerService, + @IRemoteExtensionsScannerService + remoteExtensionsScannerService: IRemoteExtensionsScannerService, @ILifecycleService lifecycleService: ILifecycleService, - @IRemoteAuthorityResolverService remoteAuthorityResolverService: IRemoteAuthorityResolverService, + @IRemoteAuthorityResolverService + remoteAuthorityResolverService: IRemoteAuthorityResolverService, @IUserDataInitializationService userDataInitializationService: IUserDataInitializationService, @IUserDataProfileService userDataProfileService: IUserDataProfileService, - @IWorkspaceTrustManagementService workspaceTrustManagementService: IWorkspaceTrustManagementService, + @IWorkspaceTrustManagementService + workspaceTrustManagementService: IWorkspaceTrustManagementService, @IRemoteExplorerService remoteExplorerService: IRemoteExplorerService, @IDialogService dialogService: IDialogService ) { @@ -162,7 +230,16 @@ export class ExtensionServiceOverride extends ExtensionService implements IExten super( extensionsProposedApi, extensionHostFactory, - new LocalBrowserExtensionHostKindPicker(workerExtHostEnabled ? [ExtensionHostKind.LocalWebWorker, ExtensionHostKind.LocalProcess, ExtensionHostKind.Remote] : [ExtensionHostKind.LocalProcess, ExtensionHostKind.Remote], logService), + new LocalBrowserExtensionHostKindPicker( + workerExtHostEnabled + ? [ + ExtensionHostKind.LocalWebWorker, + ExtensionHostKind.LocalProcess, + ExtensionHostKind.Remote + ] + : [ExtensionHostKind.LocalProcess, ExtensionHostKind.Remote], + logService + ), instantiationService, notificationService, browserEnvironmentService, @@ -188,13 +265,16 @@ export class ExtensionServiceOverride extends ExtensionService implements IExten ) } - public async deltaExtensions (toAdd: IExtensionWithExtHostKind[], toRemove: IExtension[]): Promise { + public async deltaExtensions( + toAdd: IExtensionWithExtHostKind[], + toRemove: IExtension[] + ): Promise { await this._handleDeltaExtensions(new DeltaExtensionsQueueItem(toAdd, toRemove)) } } class ExtensionResourceLoaderServiceOverride extends ExtensionResourceLoaderService { - override async readExtensionResource (uri: URI): Promise { + override async readExtensionResource(uri: URI): Promise { /** * Small hack to make it work in jest environment * The default implementation transforms the uri to a browser uri and then loads it using the file service @@ -211,19 +291,30 @@ class ExtensionResourceLoaderServiceOverride extends ExtensionResourceLoaderServ let iframeAlternateDomains: string | undefined registerAssets({ - 'vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html': () => changeUrlDomain(new URL('../../vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html', import.meta.url).href, iframeAlternateDomains) + 'vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html': () => + changeUrlDomain( + new URL( + '../../vscode/src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.esm.html', + import.meta.url + ).href, + iframeAlternateDomains + ) }) -export default function getServiceOverride (workerConfig?: WorkerConfig, _iframeAlternateDomains?: string): IEditorOverrideServices { +export default function getServiceOverride( + workerConfig?: WorkerConfig, + _iframeAlternateDomains?: string +): IEditorOverrideServices { if (_iframeAlternateDomains != null) { iframeAlternateDomains = _iframeAlternateDomains } - const _workerConfig = workerConfig != null - ? { - ...workerConfig, - url: changeUrlDomain(workerConfig.url, iframeAlternateDomains) - } - : undefined + const _workerConfig = + workerConfig != null + ? { + ...workerConfig, + url: changeUrlDomain(workerConfig.url, iframeAlternateDomains) + } + : undefined if (workerConfig != null) { registerAssets({ @@ -232,14 +323,23 @@ export default function getServiceOverride (workerConfig?: WorkerConfig, _iframe } return { - [IExtensionService.toString()]: new SyncDescriptor(ExtensionServiceOverride, [_workerConfig], false), - [IExtensionManifestPropertiesService.toString()]: new SyncDescriptor(ExtensionManifestPropertiesService, [], true), - [IExtensionResourceLoaderService.toString()]: new SyncDescriptor(ExtensionResourceLoaderServiceOverride, [], true), + [IExtensionService.toString()]: new SyncDescriptor( + ExtensionServiceOverride, + [_workerConfig], + false + ), + [IExtensionManifestPropertiesService.toString()]: new SyncDescriptor( + ExtensionManifestPropertiesService, + [], + true + ), + [IExtensionResourceLoaderService.toString()]: new SyncDescriptor( + ExtensionResourceLoaderServiceOverride, + [], + true + ), [IExtensionBisectService.toString()]: new SyncDescriptor(ExtensionBisectService, [], true) } } -export { - ExtensionHostKind, - setLocalExtensionHost -} +export { ExtensionHostKind, setLocalExtensionHost } diff --git a/src/service-override/files.ts b/src/service-override/files.ts index 879d0bf6..8fc1f81f 100644 --- a/src/service-override/files.ts +++ b/src/service-override/files.ts @@ -1,4 +1,7 @@ -import { IEditorOverrideServices, StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices' +import { + IEditorOverrideServices, + StandaloneServices +} from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { FileService, mkdirp } from 'vs/platform/files/common/fileService' import { LogLevel } from 'vs/platform/log/common/log' @@ -6,13 +9,40 @@ import { ILogService } from 'vs/platform/log/common/log.service' import { InMemoryFileSystemProvider } from 'vs/platform/files/common/inMemoryFilesystemProvider' import { URI } from 'vs/base/common/uri' import { IFileService } from 'vs/platform/files/common/files.service' -import { FileChangeType, FilePermission, FileSystemProviderCapabilities, FileType, IFileSystemProvider, createFileSystemProviderError, FileSystemProviderError, FileSystemProviderErrorCode, IFileChange, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileWriteOptions, IStat, IWatchOptions, IFileSystemProviderWithOpenReadWriteCloseCapability, IFileSystemProviderWithFileReadStreamCapability, IFileReadStreamOptions, IFileSystemProviderWithFileAtomicReadCapability, IFileSystemProviderWithFileAtomicWriteCapability, IFileSystemProviderWithFileAtomicDeleteCapability, hasFileReadStreamCapability } from 'vs/platform/files/common/files' +import { + FileChangeType, + FilePermission, + FileSystemProviderCapabilities, + FileType, + IFileSystemProvider, + createFileSystemProviderError, + FileSystemProviderError, + FileSystemProviderErrorCode, + IFileChange, + IFileDeleteOptions, + IFileOverwriteOptions, + IFileSystemProviderWithFileReadWriteCapability, + IFileWriteOptions, + IStat, + IWatchOptions, + IFileSystemProviderWithOpenReadWriteCloseCapability, + IFileSystemProviderWithFileReadStreamCapability, + IFileReadStreamOptions, + IFileSystemProviderWithFileAtomicReadCapability, + IFileSystemProviderWithFileAtomicWriteCapability, + IFileSystemProviderWithFileAtomicDeleteCapability, + hasFileReadStreamCapability +} from 'vs/platform/files/common/files' import { DisposableStore, IDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle' import { extUri } from 'vs/base/common/resources' import { Emitter, Event } from 'vs/base/common/event' import { HTMLFileSystemProvider } from 'vs/platform/files/browser/htmlFileSystemProvider' import { Schemas } from 'vs/base/common/network' -import { IndexedDBFileSystemProvider, IndexedDBFileSystemProviderErrorData, IndexedDBFileSystemProviderErrorDataClassification } from 'vs/platform/files/browser/indexedDBFileSystemProvider' +import { + IndexedDBFileSystemProvider, + IndexedDBFileSystemProviderErrorData, + IndexedDBFileSystemProviderErrorDataClassification +} from 'vs/platform/files/browser/indexedDBFileSystemProvider' import { IndexedDB } from 'vs/base/browser/indexedDB' import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry.service' import { BufferLogger } from 'vs/platform/log/common/bufferLog' @@ -32,7 +62,7 @@ import 'vs/workbench/contrib/files/browser/files.contribution._configuration.js' interface _RegisteredNode { type: FileType - stats (): Promise + stats(): Promise onDidDelete: Event onDidChange: Event } @@ -41,19 +71,19 @@ interface RegisteredFileNode extends _RegisteredNode { type: FileType.File uri: URI - read (): Promise + read(): Promise readStream?(): Promise> - write (content: Uint8Array): Promise - delete (): void + write(content: Uint8Array): Promise + delete(): void } interface RegisteredDirectoryNode extends _RegisteredNode { type: FileType.Directory - addChild (name: string, node: RegisteredNode): IDisposable - deleteChild (name: string): boolean - getChildren (name: string): RegisteredNode | undefined - read (): [string, FileType][] + addChild(name: string, node: RegisteredNode): IDisposable + deleteChild(name: string): boolean + getChildren(name: string): RegisteredNode | undefined + read(): [string, FileType][] } type RegisteredNode = RegisteredFileNode | RegisteredDirectoryNode @@ -70,14 +100,14 @@ class RegisteredDirectory implements RegisteredDirectoryNode { protected _onDidDelete = new Emitter() public onDidDelete = this._onDidDelete.event - constructor () { + constructor() { this.ctime = Date.now() this.mtime = Date.now() this.type = FileType.Directory this.entries = new Map() } - async stats (): Promise { + async stats(): Promise { return { ctime: this.ctime, mtime: this.mtime, @@ -86,11 +116,11 @@ class RegisteredDirectory implements RegisteredDirectoryNode { } } - public delete (): void { + public delete(): void { this._onDidDelete.fire() } - public addChild (name: string, node: RegisteredNode): IDisposable { + public addChild(name: string, node: RegisteredNode): IDisposable { this.entries.set(name, node) this._onDidChange.fire() @@ -107,7 +137,7 @@ class RegisteredDirectory implements RegisteredDirectoryNode { return disposable } - public deleteChild (name: string): boolean { + public deleteChild(name: string): boolean { if (this.entries.delete(name)) { this.mtime = Date.now() this._onDidChange.fire() @@ -119,11 +149,11 @@ class RegisteredDirectory implements RegisteredDirectoryNode { return false } - public getChildren (name: string): RegisteredNode | undefined { + public getChildren(name: string): RegisteredNode | undefined { return this.entries.get(name) } - public read (): [string, FileType][] { + public read(): [string, FileType][] { return Array.from(this.entries.entries()).map(([name, child]) => [name, child.type]) } } @@ -139,7 +169,10 @@ abstract class RegisteredFile implements RegisteredFileNode { protected _onDidDelete = new Emitter() public onDidDelete = this._onDidDelete.event - constructor (public uri: URI, private readonly: boolean) { + constructor( + public uri: URI, + private readonly: boolean + ) { this.ctime = Date.now() this.mtime = Date.now() @@ -148,7 +181,7 @@ abstract class RegisteredFile implements RegisteredFileNode { }) } - async stats (): Promise { + async stats(): Promise { return { ctime: this.ctime, mtime: this.mtime, @@ -158,33 +191,40 @@ abstract class RegisteredFile implements RegisteredFileNode { } } - abstract getSize (): Promise + abstract getSize(): Promise - public async delete (): Promise { + public async delete(): Promise { if (this.readonly) { - throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.FileWriteLocked) + throw createFileSystemProviderError( + 'Not allowed', + FileSystemProviderErrorCode.FileWriteLocked + ) } this._onDidDelete.fire() } - public abstract read (): Promise - public abstract write (content: Uint8Array): Promise + public abstract read(): Promise + public abstract write(content: Uint8Array): Promise } class RegisteredReadOnlyFile extends RegisteredFile { - constructor (uri: URI, public override read: () => Promise, private size: number) { + constructor( + uri: URI, + public override read: () => Promise, + private size: number + ) { super(uri, true) } - override async getSize (): Promise { + override async getSize(): Promise { return this.size } - public override write (): Promise { + public override write(): Promise { throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.FileWriteLocked) } - override async delete (): Promise { + override async delete(): Promise { throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.FileWriteLocked) } } @@ -195,17 +235,22 @@ export interface ExtensionFileMetadata { } class RegisteredUriFile extends RegisteredFile { - constructor (location: URI, private url: string, private metadata?: ExtensionFileMetadata) { + constructor( + location: URI, + private url: string, + private metadata?: ExtensionFileMetadata + ) { super(location, true) } - private async fetch () { + private async fetch() { const response = await fetch(this.url, { - headers: this.metadata?.mimeType != null - ? { - Accept: this.metadata.mimeType - } - : {} + headers: + this.metadata?.mimeType != null + ? { + Accept: this.metadata.mimeType + } + : {} }) if (response.status !== 200) { throw new Error(response.statusText) @@ -213,31 +258,31 @@ class RegisteredUriFile extends RegisteredFile { return response } - public override async getSize (): Promise { + public override async getSize(): Promise { return this.metadata?.size ?? 0 } - public override async read (): Promise { + public override async read(): Promise { const response = await this.fetch() return new Uint8Array(await response.arrayBuffer()) } - public async readStream (): Promise> { + public async readStream(): Promise> { const response = await this.fetch() return response.body! } - public override write (): Promise { + public override write(): Promise { throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.FileWriteLocked) } - override async delete (): Promise { + override async delete(): Promise { throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.FileWriteLocked) } } const encoder = new TextEncoder() -function encode (data: string | Uint8Array) { +function encode(data: string | Uint8Array) { if (data instanceof Uint8Array) { return data } else { @@ -246,32 +291,35 @@ function encode (data: string | Uint8Array) { } class RegisteredMemoryFile extends RegisteredFile { private content: Uint8Array - constructor (uri: URI, content: string | Uint8Array) { + constructor(uri: URI, content: string | Uint8Array) { super(uri, false) this.content = encode(content) } - override async getSize (): Promise { + override async getSize(): Promise { return this.content.length } - public override async read (): Promise { + public override async read(): Promise { return this.content } - public override async write (content: Uint8Array): Promise { + public override async write(content: Uint8Array): Promise { this.content = content this._onDidChange.fire() } } -class RegisteredFileSystemProvider extends Disposable implements - IFileSystemProviderWithFileReadWriteCapability, - IFileSystemProviderWithOpenReadWriteCloseCapability, - IFileSystemProviderWithFileReadStreamCapability, - IFileSystemProviderWithFileAtomicReadCapability, - IFileSystemProviderWithFileAtomicWriteCapability, - IFileSystemProviderWithFileAtomicDeleteCapability { +class RegisteredFileSystemProvider + extends Disposable + implements + IFileSystemProviderWithFileReadWriteCapability, + IFileSystemProviderWithOpenReadWriteCloseCapability, + IFileSystemProviderWithFileReadStreamCapability, + IFileSystemProviderWithFileAtomicReadCapability, + IFileSystemProviderWithFileAtomicWriteCapability, + IFileSystemProviderWithFileAtomicDeleteCapability +{ private memoryFdCounter = 0 private readonly fdMemory = new Map() private rootByAuthority: Map @@ -280,31 +328,43 @@ class RegisteredFileSystemProvider extends Disposable implements onDidChangeFile = this._onDidChangeFile.event capabilities: number - constructor (readonly: boolean) { + constructor(readonly: boolean) { super() this.rootByAuthority = new Map() - this.capabilities = FileSystemProviderCapabilities.FileReadWrite | FileSystemProviderCapabilities.PathCaseSensitive | FileSystemProviderCapabilities.FileReadStream + this.capabilities = + FileSystemProviderCapabilities.FileReadWrite | + FileSystemProviderCapabilities.PathCaseSensitive | + FileSystemProviderCapabilities.FileReadStream if (readonly) { this.capabilities |= FileSystemProviderCapabilities.Readonly } } // file open/read/write/close - async open (resource: URI): Promise { + async open(resource: URI): Promise { const data = await this.readFile(resource) const fd = this.memoryFdCounter++ this.fdMemory.set(fd, data) return fd } - async close (fd: number): Promise { + async close(fd: number): Promise { this.fdMemory.delete(fd) } - async read (fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise { + async read( + fd: number, + pos: number, + data: Uint8Array, + offset: number, + length: number + ): Promise { const memory = this.fdMemory.get(fd) if (memory == null) { - throw createFileSystemProviderError('No file with that descriptor open', FileSystemProviderErrorCode.Unavailable) + throw createFileSystemProviderError( + 'No file with that descriptor open', + FileSystemProviderErrorCode.Unavailable + ) } const toWrite = VSBuffer.wrap(memory).slice(pos, pos + length) @@ -312,10 +372,19 @@ class RegisteredFileSystemProvider extends Disposable implements return toWrite.byteLength } - write (fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise { + write( + fd: number, + pos: number, + data: Uint8Array, + offset: number, + length: number + ): Promise { const memory = this.fdMemory.get(fd) if (memory == null) { - throw createFileSystemProviderError('No file with that descriptor open', FileSystemProviderErrorCode.Unavailable) + throw createFileSystemProviderError( + 'No file with that descriptor open', + FileSystemProviderErrorCode.Unavailable + ) } const toWrite = VSBuffer.wrap(data).slice(offset, offset + length) @@ -323,7 +392,7 @@ class RegisteredFileSystemProvider extends Disposable implements return Promise.resolve(toWrite.byteLength) } - private _lookupRoot (authority: string) { + private _lookupRoot(authority: string) { const _authority = authority.toLowerCase() let root = this.rootByAuthority.get(_authority) if (root == null) { @@ -335,7 +404,7 @@ class RegisteredFileSystemProvider extends Disposable implements private _lookup(uri: URI, silent: false): RegisteredNode private _lookup(uri: URI, silent: boolean): RegisteredNode | undefined - private _lookup (uri: URI, silent: boolean): RegisteredNode | undefined { + private _lookup(uri: URI, silent: boolean): RegisteredNode | undefined { const parts = uri.path.split('/') const root = this._lookupRoot(uri.authority) @@ -350,7 +419,10 @@ class RegisteredFileSystemProvider extends Disposable implements } if (child == null) { if (!silent) { - throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound) + throw createFileSystemProviderError( + 'file not found', + FileSystemProviderErrorCode.FileNotFound + ) } else { return undefined } @@ -360,23 +432,29 @@ class RegisteredFileSystemProvider extends Disposable implements return entry } - private _lookupAsDirectory (uri: URI, silent: boolean): RegisteredDirectory { + private _lookupAsDirectory(uri: URI, silent: boolean): RegisteredDirectory { const entry = this._lookup(uri, silent) if (entry instanceof RegisteredDirectory) { return entry } - throw createFileSystemProviderError('file not a directory', FileSystemProviderErrorCode.FileNotADirectory) + throw createFileSystemProviderError( + 'file not a directory', + FileSystemProviderErrorCode.FileNotADirectory + ) } - private _lookupAsFile (uri: URI, silent: boolean): RegisteredFileNode { + private _lookupAsFile(uri: URI, silent: boolean): RegisteredFileNode { const entry = this._lookup(uri, silent) if (entry != null && entry.type === FileType.File) { return entry } - throw createFileSystemProviderError('file is a directory', FileSystemProviderErrorCode.FileIsADirectory) + throw createFileSystemProviderError( + 'file is a directory', + FileSystemProviderErrorCode.FileIsADirectory + ) } - public registerFile (file: RegisteredFileNode): IDisposable { + public registerFile(file: RegisteredFileNode): IDisposable { // Create parent directory const parts = file.uri.path.split('/') let directory = this._lookupRoot(file.uri.authority) @@ -403,21 +481,27 @@ class RegisteredFileSystemProvider extends Disposable implements throw new Error(`file '${extUri.joinPath(uri, name).toString()}/' already exists`) } const disposableStore = new DisposableStore() - disposableStore.add(toDisposable(() => { - this._fireSoon({ - resource: file.uri, - type: FileChangeType.DELETED + disposableStore.add( + toDisposable(() => { + this._fireSoon({ + resource: file.uri, + type: FileChangeType.DELETED + }) }) - })) - disposableStore.add(file.onDidDelete(() => { - disposableStore.dispose() - })) - disposableStore.add(file.onDidChange(() => { - this._fireSoon({ - resource: file.uri, - type: FileChangeType.UPDATED + ) + disposableStore.add( + file.onDidDelete(() => { + disposableStore.dispose() }) - })) + ) + disposableStore.add( + file.onDidChange(() => { + this._fireSoon({ + resource: file.uri, + type: FileChangeType.UPDATED + }) + }) + ) disposableStore.add(directory.addChild(name, file)) this._fireSoon({ @@ -427,36 +511,47 @@ class RegisteredFileSystemProvider extends Disposable implements return disposableStore } - async stat (resource: URI): Promise { + async stat(resource: URI): Promise { const node = this._lookup(resource, false) return await node.stats() } - public readdirSync (resource: URI): [string, FileType][] { + public readdirSync(resource: URI): [string, FileType][] { const directory = this._lookupAsDirectory(resource, false) return directory.read() } - public async readdir (resource: URI): Promise<[string, FileType][]> { + public async readdir(resource: URI): Promise<[string, FileType][]> { return this.readdirSync(resource) } - async readFile (resource: URI): Promise { + async readFile(resource: URI): Promise { const file = this._lookupAsFile(resource, false) return await file.read() } - readFileStream (resource: URI, opts: IFileReadStreamOptions, token: CancellationToken): ReadableStreamEvents { + readFileStream( + resource: URI, + opts: IFileReadStreamOptions, + token: CancellationToken + ): ReadableStreamEvents { const file = this._lookupAsFile(resource, false) // This function is greatly inspired from HtmlFileSystemProvider from VSCode - const stream = newWriteableStream(data => VSBuffer.concat(data.map(data => VSBuffer.wrap(data))).buffer, { - highWaterMark: 10 - }) + const stream = newWriteableStream( + (data) => VSBuffer.concat(data.map((data) => VSBuffer.wrap(data))).buffer, + { + highWaterMark: 10 + } + ) void (async () => { try { - if (file.readStream == null || typeof opts.length === 'number' || typeof opts.position === 'number') { + if ( + file.readStream == null || + typeof opts.length === 'number' || + typeof opts.position === 'number' + ) { let buffer = await file.read() if (typeof opts.position === 'number' || typeof opts.length === 'number') { @@ -465,7 +560,9 @@ class RegisteredFileSystemProvider extends Disposable implements stream.end(buffer) } else { - const reader: ReadableStreamDefaultReader = (await file.readStream()).getReader() + const reader: ReadableStreamDefaultReader = ( + await file.readStream() + ).getReader() let res = await reader.read() while (!res.done) { @@ -485,7 +582,9 @@ class RegisteredFileSystemProvider extends Disposable implements stream.end(undefined) } } catch (error) { - stream.error(createFileSystemProviderError(error as Error, FileSystemProviderErrorCode.Unknown)) + stream.error( + createFileSystemProviderError(error as Error, FileSystemProviderErrorCode.Unknown) + ) stream.end() } })() @@ -493,31 +592,43 @@ class RegisteredFileSystemProvider extends Disposable implements return stream } - watch (): IDisposable { + watch(): IDisposable { return Disposable.None } - async writeFile (resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise { + async writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise { const node = this._lookup(resource, true) if (node != null && !(node instanceof RegisteredFile)) { - throw createFileSystemProviderError('file is directory', FileSystemProviderErrorCode.FileIsADirectory) + throw createFileSystemProviderError( + 'file is directory', + FileSystemProviderErrorCode.FileIsADirectory + ) } if (node == null) { - throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound) + throw createFileSystemProviderError( + 'file not found', + FileSystemProviderErrorCode.FileNotFound + ) } if (!opts.overwrite) { - throw createFileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists) + throw createFileSystemProviderError( + 'file exists already', + FileSystemProviderErrorCode.FileExists + ) } await node.write(content) } - async rename (): Promise { + async rename(): Promise { throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions) } - mkdirSync (resource: URI): RegisteredDirectoryNode { + mkdirSync(resource: URI): RegisteredDirectoryNode { if (this._lookup(resource, true) != null) { - throw createFileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists) + throw createFileSystemProviderError( + 'file exists already', + FileSystemProviderErrorCode.FileExists + ) } const basename = resources.basename(resource) @@ -526,45 +637,55 @@ class RegisteredFileSystemProvider extends Disposable implements const directory = new RegisteredDirectory() const disposable = new DisposableStore() - disposable.add(directory.onDidDelete(() => { - disposable.dispose() - this._fireSoon({ - resource, - type: FileChangeType.DELETED + disposable.add( + directory.onDidDelete(() => { + disposable.dispose() + this._fireSoon({ + resource, + type: FileChangeType.DELETED + }) }) - })) - disposable.add(directory.onDidChange(() => { - this._fireSoon({ - resource, - type: FileChangeType.UPDATED + ) + disposable.add( + directory.onDidChange(() => { + this._fireSoon({ + resource, + type: FileChangeType.UPDATED + }) }) - })) + ) parent.addChild(basename, directory) this._fireSoon({ type: FileChangeType.ADDED, resource }) return directory } - async mkdir (): Promise { - throw createFileSystemProviderError('Can\' create a directory', FileSystemProviderErrorCode.NoPermissions) + async mkdir(): Promise { + throw createFileSystemProviderError( + "Can' create a directory", + FileSystemProviderErrorCode.NoPermissions + ) } - private deleteSync (resource: URI): void { + private deleteSync(resource: URI): void { const node = this._lookup(resource, true) if (node == null) { throw createFileSystemProviderError('Not found', FileSystemProviderErrorCode.FileNotFound) } else if (node.type === FileType.Directory) { - throw createFileSystemProviderError('Can\'t delete a directory', FileSystemProviderErrorCode.NoPermissions) + throw createFileSystemProviderError( + "Can't delete a directory", + FileSystemProviderErrorCode.NoPermissions + ) } node.delete() } - async delete (resource: URI): Promise { + async delete(resource: URI): Promise { this.deleteSync(resource) } private _bufferedChanges: IFileChange[] = [] private _fireSoonHandle?: number - private _fireSoon (...changes: IFileChange[]): void { + private _fireSoon(...changes: IFileChange[]): void { this._bufferedChanges.push(...changes) if (this._fireSoonHandle != null) { @@ -579,27 +700,37 @@ class RegisteredFileSystemProvider extends Disposable implements } } -function isFullfiled (result: PromiseSettledResult): result is PromiseFulfilledResult { +function isFullfiled(result: PromiseSettledResult): result is PromiseFulfilledResult { return result.status === 'fulfilled' } -class OverlayFileSystemProvider implements -IFileSystemProviderWithFileReadWriteCapability, -IFileSystemProviderWithFileReadStreamCapability, -IFileSystemProviderWithFileAtomicReadCapability, -IFileSystemProviderWithFileAtomicWriteCapability, -IFileSystemProviderWithFileAtomicDeleteCapability { - private providers: { priority: number, provider: IFileSystemProviderWithFileReadWriteCapability }[] = [] - - public register (priority: number, provider: IFileSystemProviderWithFileReadWriteCapability): IDisposable { +class OverlayFileSystemProvider + implements + IFileSystemProviderWithFileReadWriteCapability, + IFileSystemProviderWithFileReadStreamCapability, + IFileSystemProviderWithFileAtomicReadCapability, + IFileSystemProviderWithFileAtomicWriteCapability, + IFileSystemProviderWithFileAtomicDeleteCapability +{ + private providers: { + priority: number + provider: IFileSystemProviderWithFileReadWriteCapability + }[] = [] + + public register( + priority: number, + provider: IFileSystemProviderWithFileReadWriteCapability + ): IDisposable { const item = { priority, provider } this.providers.push(item) this.providers.sort((a, b) => b.priority - a.priority) const disposableStore = new DisposableStore() - disposableStore.add(provider.onDidChangeFile(e => { - this._onDidChangeFile.fire(e) - })) + disposableStore.add( + provider.onDidChangeFile((e) => { + this._onDidChangeFile.fire(e) + }) + ) disposableStore.add({ dispose: () => { const index = this.providers.indexOf(item) @@ -613,7 +744,7 @@ IFileSystemProviderWithFileAtomicDeleteCapability { return disposableStore } - get delegates (): IFileSystemProviderWithFileReadWriteCapability[] { + get delegates(): IFileSystemProviderWithFileReadWriteCapability[] { return this.providers.map(({ provider }) => provider) } @@ -624,9 +755,15 @@ IFileSystemProviderWithFileAtomicDeleteCapability { _onDidChangeOverlays = new Emitter() onDidChangeOverlays = this._onDidChangeOverlays.event - capabilities = FileSystemProviderCapabilities.FileReadWrite | FileSystemProviderCapabilities.PathCaseSensitive | FileSystemProviderCapabilities.FileReadStream + capabilities = + FileSystemProviderCapabilities.FileReadWrite | + FileSystemProviderCapabilities.PathCaseSensitive | + FileSystemProviderCapabilities.FileReadStream - private async readFromDelegates (caller: (delegate: IFileSystemProviderWithFileReadWriteCapability) => Promise, token?: CancellationToken) { + private async readFromDelegates( + caller: (delegate: IFileSystemProviderWithFileReadWriteCapability) => Promise, + token?: CancellationToken + ) { if (this.delegates.length === 0) { throw createFileSystemProviderError('No delegate', FileSystemProviderErrorCode.Unavailable) } @@ -639,11 +776,14 @@ IFileSystemProviderWithFileAtomicDeleteCapability { return await caller(delegate) } catch (err) { firstError ??= err - if (err instanceof FileSystemProviderError && [ - FileSystemProviderErrorCode.NoPermissions, - FileSystemProviderErrorCode.FileNotFound, - FileSystemProviderErrorCode.Unavailable - ].includes(err.code)) { + if ( + err instanceof FileSystemProviderError && + [ + FileSystemProviderErrorCode.NoPermissions, + FileSystemProviderErrorCode.FileNotFound, + FileSystemProviderErrorCode.Unavailable + ].includes(err.code) + ) { continue } throw err @@ -652,7 +792,9 @@ IFileSystemProviderWithFileAtomicDeleteCapability { throw firstError } - private async writeToDelegates (caller: (delegate: IFileSystemProviderWithFileReadWriteCapability) => Promise): Promise { + private async writeToDelegates( + caller: (delegate: IFileSystemProviderWithFileReadWriteCapability) => Promise + ): Promise { if (this.delegates.length === 0) { throw createFileSystemProviderError('No delegate', FileSystemProviderErrorCode.Unavailable) } @@ -663,11 +805,14 @@ IFileSystemProviderWithFileAtomicDeleteCapability { try { return await caller(provider) } catch (err) { - if (err instanceof FileSystemProviderError && [ - FileSystemProviderErrorCode.NoPermissions, - FileSystemProviderErrorCode.FileNotFound, - FileSystemProviderErrorCode.Unavailable - ].includes(err.code)) { + if ( + err instanceof FileSystemProviderError && + [ + FileSystemProviderErrorCode.NoPermissions, + FileSystemProviderErrorCode.FileNotFound, + FileSystemProviderErrorCode.Unavailable + ].includes(err.code) + ) { continue } throw err @@ -676,8 +821,8 @@ IFileSystemProviderWithFileAtomicDeleteCapability { throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions) } - async stat (resource: URI): Promise { - return await this.readFromDelegates(async delegate => { + async stat(resource: URI): Promise { + return await this.readFromDelegates(async (delegate) => { const result = await delegate.stat(resource) const readOnly = (delegate.capabilities & FileSystemProviderCapabilities.Readonly) > 0 @@ -688,34 +833,44 @@ IFileSystemProviderWithFileAtomicDeleteCapability { }) } - async readFile (resource: URI): Promise { - return await this.readFromDelegates(delegate => delegate.readFile(resource)) + async readFile(resource: URI): Promise { + return await this.readFromDelegates((delegate) => delegate.readFile(resource)) } - readFileStream (resource: URI, opts: IFileReadStreamOptions, token: CancellationToken): ReadableStreamEvents { - const writableStream = newWriteableStream(data => VSBuffer.concat(data.map(data => VSBuffer.wrap(data))).buffer) - this.readFromDelegates(async delegate => { + readFileStream( + resource: URI, + opts: IFileReadStreamOptions, + token: CancellationToken + ): ReadableStreamEvents { + const writableStream = newWriteableStream( + (data) => VSBuffer.concat(data.map((data) => VSBuffer.wrap(data))).buffer + ) + this.readFromDelegates(async (delegate) => { if (hasFileReadStreamCapability(delegate)) { const stream = delegate.readFileStream(resource, opts, token) await new Promise((resolve, reject) => { let dataReceived = false - listenStream(stream, { - onData (data) { - dataReceived = true - void writableStream.write(data) - }, - onEnd () { - writableStream.end() - resolve() - }, - onError (err) { - if (!dataReceived) { - reject(err) - } else { - writableStream.error(err) + listenStream( + stream, + { + onData(data) { + dataReceived = true + void writableStream.write(data) + }, + onEnd() { + writableStream.end() + resolve() + }, + onError(err) { + if (!dataReceived) { + reject(err) + } else { + writableStream.error(err) + } } - } - }, token) + }, + token + ) }) } else { let data = await this.readFile(resource) @@ -724,22 +879,31 @@ IFileSystemProviderWithFileAtomicDeleteCapability { } return writableStream.end(data) } - }, token).catch(err => { + }, token).catch((err) => { writableStream.error(err) }) return writableStream } - async readdir (resource: URI): Promise<[string, FileType][]> { - const results = await Promise.allSettled(this.delegates.map(async delegate => await delegate.readdir(resource))) + async readdir(resource: URI): Promise<[string, FileType][]> { + const results = await Promise.allSettled( + this.delegates.map(async (delegate) => await delegate.readdir(resource)) + ) if (!results.some(isFullfiled)) { throw (results[0] as PromiseRejectedResult).reason } - return Object.entries(Object.fromEntries(results.filter(isFullfiled).map(result => result.value).flat())) + return Object.entries( + Object.fromEntries( + results + .filter(isFullfiled) + .map((result) => result.value) + .flat() + ) + ) } - watch (resource: URI, opts: IWatchOptions): IDisposable { + watch(resource: URI, opts: IWatchOptions): IDisposable { const store = new DisposableStore() for (const delegate of this.delegates) { store.add(delegate.watch(resource, opts)) @@ -747,8 +911,8 @@ IFileSystemProviderWithFileAtomicDeleteCapability { return store } - async writeFile (resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise { - await this.writeToDelegates(async delegate => { + async writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise { + await this.writeToDelegates(async (delegate) => { let stats: IStat | undefined try { stats = await delegate.stat(resource) @@ -756,27 +920,34 @@ IFileSystemProviderWithFileAtomicDeleteCapability { // ignore } if (stats != null && ((stats.permissions ?? 0) & FilePermission.Readonly) > 0) { - throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions) + throw createFileSystemProviderError( + 'Not allowed', + FileSystemProviderErrorCode.NoPermissions + ) } return await delegate.writeFile(resource, content, opts) }) } - async mkdir (resource: URI): Promise { - await this.writeToDelegates(delegate => delegate.mkdir(resource)) + async mkdir(resource: URI): Promise { + await this.writeToDelegates((delegate) => delegate.mkdir(resource)) } - async delete (resource: URI, opts: IFileDeleteOptions): Promise { - await this.writeToDelegates(delegate => delegate.delete(resource, opts)) + async delete(resource: URI, opts: IFileDeleteOptions): Promise { + await this.writeToDelegates((delegate) => delegate.delete(resource, opts)) } - async rename (from: URI, to: URI, opts: IFileOverwriteOptions): Promise { - await this.writeToDelegates(delegate => delegate.rename(from, to, opts)) + async rename(from: URI, to: URI, opts: IFileOverwriteOptions): Promise { + await this.writeToDelegates((delegate) => delegate.rename(from, to, opts)) } } class MkdirpOnWriteInMemoryFileSystemProvider extends InMemoryFileSystemProvider { - override async writeFile (resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise { + override async writeFile( + resource: URI, + content: Uint8Array, + opts: IFileWriteOptions + ): Promise { // when using overlay providers, the fileservice won't be able to detect that the parent directory doesn't exist // if another provider has this directory. So it won't create the parent directories on this memory file system. await mkdirp(extUri, this, extUri.dirname(resource)) @@ -786,89 +957,104 @@ class MkdirpOnWriteInMemoryFileSystemProvider extends InMemoryFileSystemProvider } class DelegateFileSystemProvider implements IFileSystemProvider { - constructor (private options: { - delegate: IFileSystemProvider - toDelegate: (uri: URI) => URI - fromDeletate: (uri: URI) => URI - }) {} + constructor( + private options: { + delegate: IFileSystemProvider + toDelegate: (uri: URI) => URI + fromDeletate: (uri: URI) => URI + } + ) {} + + get capabilities(): FileSystemProviderCapabilities { + return this.options.delegate.capabilities + } - get capabilities (): FileSystemProviderCapabilities { return this.options.delegate.capabilities } onDidChangeCapabilities = this.options.delegate.onDidChangeCapabilities - onDidChangeFile = Event.map(this.options.delegate.onDidChangeFile, changes => changes.map(change => ({ - type: change.type, - resource: this.options.fromDeletate(change.resource) - }))) - - readFile = this.options.delegate.readFile != null - ? (resource: URI): Promise => { - return this.options.delegate.readFile!(this.options.toDelegate(resource)) - } - : undefined + onDidChangeFile = Event.map(this.options.delegate.onDidChangeFile, (changes) => + changes.map((change) => ({ + type: change.type, + resource: this.options.fromDeletate(change.resource) + })) + ) - writeFile = this.options.delegate.writeFile != null - ? (resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise => { - return this.options.delegate.writeFile!(this.options.toDelegate(resource), content, opts) - } - : undefined + readFile = + this.options.delegate.readFile != null + ? (resource: URI): Promise => { + return this.options.delegate.readFile!(this.options.toDelegate(resource)) + } + : undefined - watch (resource: URI, opts: IWatchOptions): IDisposable { + writeFile = + this.options.delegate.writeFile != null + ? (resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise => { + return this.options.delegate.writeFile!(this.options.toDelegate(resource), content, opts) + } + : undefined + + watch(resource: URI, opts: IWatchOptions): IDisposable { return this.options.delegate.watch(this.options.toDelegate(resource), opts) } - stat (resource: URI): Promise { + stat(resource: URI): Promise { return this.options.delegate.stat(this.options.toDelegate(resource)) } - mkdir (resource: URI): Promise { + mkdir(resource: URI): Promise { return this.options.delegate.mkdir(this.options.toDelegate(resource)) } - readdir (resource: URI): Promise<[string, FileType][]> { + readdir(resource: URI): Promise<[string, FileType][]> { return this.options.delegate.readdir(this.options.toDelegate(resource)) } - delete (resource: URI, opts: IFileDeleteOptions): Promise { + delete(resource: URI, opts: IFileDeleteOptions): Promise { return this.options.delegate.delete(this.options.toDelegate(resource), opts) } - rename (from: URI, to: URI, opts: IFileOverwriteOptions): Promise { - return this.options.delegate.rename(this.options.toDelegate(from), this.options.toDelegate(to), opts) + rename(from: URI, to: URI, opts: IFileOverwriteOptions): Promise { + return this.options.delegate.rename( + this.options.toDelegate(from), + this.options.toDelegate(to), + opts + ) } } class EmptyFileSystemProvider implements IFileSystemProviderWithFileReadWriteCapability { - async readFile (): Promise { + async readFile(): Promise { throw createFileSystemProviderError('Not found', FileSystemProviderErrorCode.FileNotFound) } - async writeFile (): Promise { + async writeFile(): Promise { throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions) } - capabilities = FileSystemProviderCapabilities.FileReadWrite | FileSystemProviderCapabilities.PathCaseSensitive + capabilities = + FileSystemProviderCapabilities.FileReadWrite | FileSystemProviderCapabilities.PathCaseSensitive + onDidChangeCapabilities = Event.None onDidChangeFile = Event.None - watch (): IDisposable { + watch(): IDisposable { return Disposable.None } - async stat (): Promise { + async stat(): Promise { throw createFileSystemProviderError('Not found', FileSystemProviderErrorCode.FileNotFound) } - async mkdir (): Promise { + async mkdir(): Promise { throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions) } - async readdir (): Promise<[string, FileType][]> { + async readdir(): Promise<[string, FileType][]> { throw createFileSystemProviderError('Not found', FileSystemProviderErrorCode.FileNotFound) } - async delete (): Promise { + async delete(): Promise { throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions) } - async rename (): Promise { + async rename(): Promise { throw createFileSystemProviderError('Not allowed', FileSystemProviderErrorCode.NoPermissions) } } @@ -900,7 +1086,7 @@ const providers: Record = { } class FileServiceOverride extends FileService { - constructor (logService: ILogService, @ITelemetryService telemetryService: ITelemetryService) { + constructor(logService: ILogService, @ITelemetryService telemetryService: ITelemetryService) { super(logService) for (const [scheme, provider] of Object.entries(providers)) { @@ -913,7 +1099,14 @@ class FileServiceOverride extends FileService { } if (provider instanceof IndexedDBFileSystemProvider) { - this._register(provider.onReportError(e => telemetryService.publicLog2('indexedDBFileSystemProviderError', e))) + this._register( + provider.onReportError((e) => + telemetryService.publicLog2< + IndexedDBFileSystemProviderErrorData, + IndexedDBFileSystemProviderErrorDataClassification + >('indexedDBFileSystemProviderError', e) + ) + ) } } } @@ -926,11 +1119,15 @@ registerServiceInitializePreParticipant(async (accessor) => { fileLogger.logger = accessor.get(ILogService) }) -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IFileService.toString()]: new SyncDescriptor(FileServiceOverride, [fileLogger], true), [ITextFileService.toString()]: new SyncDescriptor(BrowserTextFileService, [], true), - [IFilesConfigurationService.toString()]: new SyncDescriptor(FilesConfigurationService, [], true), + [IFilesConfigurationService.toString()]: new SyncDescriptor( + FilesConfigurationService, + [], + true + ), [IElevatedFileService.toString()]: new SyncDescriptor(BrowserElevatedFileService, [], true) } } @@ -939,19 +1136,23 @@ export default function getServiceOverride (): IEditorOverrideServices { * Register a custom file system provider for the given scheme. This allows us to override * the default file system provider for a given scheme. */ -export function registerCustomProvider (scheme: string, provider: IFileSystemProvider): void { +export function registerCustomProvider(scheme: string, provider: IFileSystemProvider): void { checkServicesNotInitialized() providers[scheme] = provider } -export function registerExtensionFile (file: RegisteredFileNode): IDisposable { +export function registerExtensionFile(file: RegisteredFileNode): IDisposable { return extensionFileSystemProvider.registerFile(file) } /** * Can be used to create a file before the fileService is initialized */ -export async function initFile (file: URI, content: Uint8Array | string, options?: Partial): Promise { +export async function initFile( + file: URI, + content: Uint8Array | string, + options?: Partial +): Promise { checkServicesNotInitialized() const provider = providers[file.scheme] if (provider == null || provider.writeFile == null) { @@ -963,7 +1164,10 @@ export async function initFile (file: URI, content: Uint8Array | string, options // The file already exists, do nothing return } catch (error) { - if (!(error instanceof FileSystemProviderError) || error.code !== FileSystemProviderErrorCode.FileNotFound) { + if ( + !(error instanceof FileSystemProviderError) || + error.code !== FileSystemProviderErrorCode.FileNotFound + ) { console.error('Unable to check if file exists', error) } // File not found, write it @@ -986,13 +1190,21 @@ const handlesStore = 'vscode-filehandles-store' /** * Can be used to replace memory providers by indexeddb providers before the fileService is initialized */ -export async function createIndexedDBProviders (): Promise { +export async function createIndexedDBProviders(): Promise { indexedDB = await IndexedDB.create('vscode-web-db', 3, [userDataStore, logsStore, handlesStore]) // Logger - registerCustomProvider(logsPath.scheme, new IndexedDBFileSystemProvider(logsPath.scheme, indexedDB, logsStore, false)) - - const userDataProvider = new IndexedDBFileSystemProvider(Schemas.vscodeUserData, indexedDB, userDataStore, true) + registerCustomProvider( + logsPath.scheme, + new IndexedDBFileSystemProvider(logsPath.scheme, indexedDB, logsStore, false) + ) + + const userDataProvider = new IndexedDBFileSystemProvider( + Schemas.vscodeUserData, + indexedDB, + userDataStore, + true + ) registerCustomProvider(Schemas.vscodeUserData, userDataProvider) return userDataProvider @@ -1002,50 +1214,53 @@ export async function createIndexedDBProviders (): Promise, file: URI = defaultUserKeybindindsFile): Promise { +async function initUserKeybindings( + configurationJson: string, + options?: Partial, + file: URI = defaultUserKeybindindsFile +): Promise { await initFile(file, configurationJson, options) } @@ -49,16 +56,23 @@ async function initUserKeybindings (configurationJson: string, options?: Partial * Can be called at any time after the services are initialized to update the user configuration */ -async function updateUserKeybindings (keybindingsJson: string): Promise { - const userDataProfilesService: IUserDataProfilesService = await getService(IUserDataProfilesService) +async function updateUserKeybindings(keybindingsJson: string): Promise { + const userDataProfilesService: IUserDataProfilesService = + await getService(IUserDataProfilesService) const fileService = await getService(IFileService) - await fileService.writeFile(userDataProfilesService.defaultProfile.keybindingsResource, VSBuffer.fromString(keybindingsJson)) + await fileService.writeFile( + userDataProfilesService.defaultProfile.keybindingsResource, + VSBuffer.fromString(keybindingsJson) + ) } -class DynamicWorkbenchKeybindingService extends WorkbenchKeybindingService implements DynamicKeybindingService { +class DynamicWorkbenchKeybindingService + extends WorkbenchKeybindingService + implements DynamicKeybindingService +{ private keybindingProviders: KeybindingProvider[] = [] - constructor ( + constructor( private shouldUseGlobalKeybindings: () => boolean, @IContextKeyService contextKeyService: IContextKeyService, @ICommandService commandService: ICommandService, @@ -72,42 +86,61 @@ class DynamicWorkbenchKeybindingService extends WorkbenchKeybindingService imple @ILogService logService: ILogService, @IKeyboardLayoutService keyboardLayoutService: IKeyboardLayoutService ) { - super(contextKeyService, commandService, telemetryService, notificationService, userDataProfileService, hostService, extensionService, fileService, uriIdentityService, logService, keyboardLayoutService) + super( + contextKeyService, + commandService, + telemetryService, + notificationService, + userDataProfileService, + hostService, + extensionService, + fileService, + uriIdentityService, + logService, + keyboardLayoutService + ) } - public registerKeybindingProvider (provider: KeybindingProvider) { + public registerKeybindingProvider(provider: KeybindingProvider) { this.keybindingProviders.push(provider) this.updateResolver() const store = new DisposableStore() - store.add(provider.onDidChangeKeybindings(() => { - this.updateResolver() - })) - - store.add(toDisposable(() => { - const idx = this.keybindingProviders.indexOf(provider) - if (idx >= 0) { - this.keybindingProviders.splice(idx, 1) + store.add( + provider.onDidChangeKeybindings(() => { this.updateResolver() - } - })) + }) + ) + + store.add( + toDisposable(() => { + const idx = this.keybindingProviders.indexOf(provider) + if (idx >= 0) { + this.keybindingProviders.splice(idx, 1) + this.updateResolver() + } + }) + ) return store } - public override _getResolver (): KeybindingResolver { + public override _getResolver(): KeybindingResolver { return super._getResolver() } - protected override _dispatch (e: IKeyboardEvent, target: IContextKeyServiceTarget): boolean { + protected override _dispatch(e: IKeyboardEvent, target: IContextKeyServiceTarget): boolean { if (!this.shouldUseGlobalKeybindings()) { return false } return super._dispatch(e, target) } - protected override getUserKeybindingItems () { - return [...super.getUserKeybindingItems(), ...this.keybindingProviders.flatMap(provider => provider.provideKeybindings())] + protected override getUserKeybindingItems() { + return [ + ...super.getUserKeybindingItems(), + ...this.keybindingProviders.flatMap((provider) => provider.provideKeybindings()) + ] } } @@ -119,10 +152,16 @@ onRenderWorkbench((accessor) => { accessor.get(IInstantiationService).createInstance(WorkbenchContextKeysHandler) }) -export default function getServiceOverride ({ shouldUseGlobalKeybindings = () => false }: KeybindingsProps = {}): IEditorOverrideServices { +export default function getServiceOverride({ + shouldUseGlobalKeybindings = () => false +}: KeybindingsProps = {}): IEditorOverrideServices { return { ...getFileServiceOverride(), - [IKeybindingService.toString()]: new SyncDescriptor(DynamicWorkbenchKeybindingService, [shouldUseGlobalKeybindings], false), + [IKeybindingService.toString()]: new SyncDescriptor( + DynamicWorkbenchKeybindingService, + [shouldUseGlobalKeybindings], + false + ), [IKeyboardLayoutService.toString()]: new SyncDescriptor(BrowserKeyboardLayoutService, [], true), [ICommandService.toString()]: new SyncDescriptor(CommandService, [], true) } diff --git a/src/service-override/languageDetectionWorker.ts b/src/service-override/languageDetectionWorker.ts index 4beda897..c56e2e4e 100644 --- a/src/service-override/languageDetectionWorker.ts +++ b/src/service-override/languageDetectionWorker.ts @@ -6,11 +6,17 @@ import { registerAssets } from '../assets' import 'vs/workbench/contrib/languageDetection/browser/languageDetection.contribution' registerAssets({ - 'vs/../../node_modules/@vscode/vscode-languagedetection/model/model.json': new URL('@vscode/vscode-languagedetection/model/model.json', import.meta.url).href, - 'vs/../../node_modules/@vscode/vscode-languagedetection/model/group1-shard1of1.bin': new URL('@vscode/vscode-languagedetection/model/group1-shard1of1.bin', import.meta.url).href + 'vs/../../node_modules/@vscode/vscode-languagedetection/model/model.json': new URL( + '@vscode/vscode-languagedetection/model/model.json', + import.meta.url + ).href, + 'vs/../../node_modules/@vscode/vscode-languagedetection/model/group1-shard1of1.bin': new URL( + '@vscode/vscode-languagedetection/model/group1-shard1of1.bin', + import.meta.url + ).href }) -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ILanguageDetectionService.toString()]: new SyncDescriptor(LanguageDetectionService, [], false) } diff --git a/src/service-override/languages.ts b/src/service-override/languages.ts index 77c343ee..394348a4 100644 --- a/src/service-override/languages.ts +++ b/src/service-override/languages.ts @@ -7,7 +7,7 @@ import { ILanguageStatusService } from 'vs/workbench/services/languageStatus/com import getFileServiceOverride from './files' import 'vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { ...getFileServiceOverride(), [ILanguageService.toString()]: new SyncDescriptor(WorkbenchLanguageService, [], false), diff --git a/src/service-override/layout.ts b/src/service-override/layout.ts index 6a5a5b4e..d8650671 100644 --- a/src/service-override/layout.ts +++ b/src/service-override/layout.ts @@ -1,5 +1,16 @@ -import { IEditorOverrideServices, StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices' -import { ActivityBarPosition, LayoutSettings, PanelAlignment, Parts, Position, positionFromString, positionToString } from 'vs/workbench/services/layout/browser/layoutService' +import { + IEditorOverrideServices, + StandaloneServices +} from 'vs/editor/standalone/browser/standaloneServices' +import { + ActivityBarPosition, + LayoutSettings, + PanelAlignment, + Parts, + Position, + positionFromString, + positionToString +} from 'vs/workbench/services/layout/browser/layoutService' import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService.service' import { ILayoutOffsetInfo } from 'vs/platform/layout/browser/layoutService' import { ILayoutService } from 'vs/platform/layout/browser/layoutService.service' @@ -43,9 +54,7 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe private sideBarPosition!: Position private panelPosition!: Position - constructor ( - public mainContainer: HTMLElement = getWorkbenchContainer() - ) { + constructor(public mainContainer: HTMLElement = getWorkbenchContainer()) { super() window.addEventListener('resize', () => this.layout()) this.layout() @@ -63,7 +72,7 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe document.body.classList.add('web') } - whenContainerStylesLoaded (): undefined { + whenContainerStylesLoaded(): undefined { return undefined } @@ -71,25 +80,30 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe whenActiveContainerStylesLoaded = Promise.resolve() - hasMainWindowBorder (): boolean { + hasMainWindowBorder(): boolean { return false } - getMainWindowBorderRadius (): string | undefined { + getMainWindowBorderRadius(): string | undefined { return undefined } - isMainEditorLayoutCentered (): boolean { + isMainEditorLayoutCentered(): boolean { return false } - centerMainEditorLayout (): void { - } + centerMainEditorLayout(): void {} + + private readonly _onDidLayoutContainer = this._register( + new Emitter<{ readonly container: HTMLElement; readonly dimension: dom.IDimension }>() + ) - private readonly _onDidLayoutContainer = this._register(new Emitter<{ readonly container: HTMLElement, readonly dimension: dom.IDimension }>()) readonly onDidLayoutContainer = this._onDidLayoutContainer.event - private readonly _onDidAddContainer = this._register(new Emitter<{ readonly container: HTMLElement, readonly disposables: DisposableStore }>()) + private readonly _onDidAddContainer = this._register( + new Emitter<{ readonly container: HTMLElement; readonly disposables: DisposableStore }>() + ) + readonly onDidAddContainer = this._onDidAddContainer.event private readonly _onDidRemoveContainer = this._register(new Emitter()) @@ -103,8 +117,11 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe private readonly _onDidChangeActiveContainer = this._register(new Emitter()) readonly onDidChangeActiveContainer = this._onDidChangeActiveContainer.event - get activeContainer (): HTMLElement { return this.getContainerFromDocument(dom.getActiveDocument()) } - get containers (): Iterable { + get activeContainer(): HTMLElement { + return this.getContainerFromDocument(dom.getActiveDocument()) + } + + get containers(): Iterable { const containers: HTMLElement[] = [] for (const { window } of dom.getWindows()) { containers.push(this.getContainerFromDocument(window.document)) @@ -113,7 +130,7 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe return containers } - private getContainerFromDocument (document: Document): HTMLElement { + private getContainerFromDocument(document: Document): HTMLElement { if (document === this.mainContainer.ownerDocument) { // main window return this.mainContainer @@ -139,7 +156,7 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe openedDefaultEditors = false whenRestored = Promise.resolve() - public init (accessor: ServicesAccessor): void { + public init(accessor: ServicesAccessor): void { this.editorGroupService = accessor.get(IEditorGroupsService) this.paneCompositeService = accessor.get(IPaneCompositePartService) this.statusBarService = accessor.get(IStatusbarService) @@ -148,41 +165,75 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe this.auxiliaryWindowService = accessor.get(IAuxiliaryWindowService) this.hostService = accessor.get(IHostService) - this._register(this.configurationService.onDidChangeConfiguration((e) => { - if (e.affectsConfiguration(LayoutSettings.ACTIVITY_BAR_LOCATION)) { - this.setPartHidden(this.isActivityBarHidden(), Parts.ACTIVITYBAR_PART) - } + this._register( + this.configurationService.onDidChangeConfiguration((e) => { + if (e.affectsConfiguration(LayoutSettings.ACTIVITY_BAR_LOCATION)) { + this.setPartHidden(this.isActivityBarHidden(), Parts.ACTIVITYBAR_PART) + } - if (e.affectsConfiguration('workbench.statusBar.visible')) { - this.setPartHidden(!this.configurationService.getValue('workbench.statusBar.visible'), Parts.STATUSBAR_PART) - } + if (e.affectsConfiguration('workbench.statusBar.visible')) { + this.setPartHidden( + !this.configurationService.getValue('workbench.statusBar.visible'), + Parts.STATUSBAR_PART + ) + } - if (e.affectsConfiguration('workbench.sideBar.location')) { - this.setSideBarPosition(positionFromString(this.configurationService.getValue('workbench.sideBar.location') ?? 'left')) - } + if (e.affectsConfiguration('workbench.sideBar.location')) { + this.setSideBarPosition( + positionFromString( + this.configurationService.getValue( + 'workbench.sideBar.location' + ) ?? 'left' + ) + ) + } - if (e.affectsConfiguration('workbench.panel.defaultLocation')) { - this.setPanelPosition(positionFromString(this.configurationService.getValue('workbench.panel.defaultLocation') ?? 'bottom')) - } - })) + if (e.affectsConfiguration('workbench.panel.defaultLocation')) { + this.setPanelPosition( + positionFromString( + this.configurationService.getValue( + 'workbench.panel.defaultLocation' + ) ?? 'bottom' + ) + ) + } + }) + ) this.setPartHidden(this.isActivityBarHidden(), Parts.ACTIVITYBAR_PART) - this.setPartHidden(!this.configurationService.getValue('workbench.statusBar.visible'), Parts.STATUSBAR_PART) - this.sideBarPosition = positionFromString(this.configurationService.getValue('workbench.sideBar.location') ?? 'left') - this.panelPosition = positionFromString(this.configurationService.getValue('workbench.panel.defaultLocation') ?? 'bottom') + this.setPartHidden( + !this.configurationService.getValue('workbench.statusBar.visible'), + Parts.STATUSBAR_PART + ) + this.sideBarPosition = positionFromString( + this.configurationService.getValue('workbench.sideBar.location') ?? 'left' + ) + this.panelPosition = positionFromString( + this.configurationService.getValue('workbench.panel.defaultLocation') ?? + 'bottom' + ) // Window active / focus changes this._register(this.hostService.onDidChangeActiveWindow(() => this.onActiveWindowChanged())) // Auxiliary windows - this._register(this.auxiliaryWindowService.onDidOpenAuxiliaryWindow(({ window, disposables }) => { - this._onDidAddContainer.fire({ container: window.container, disposables: new DisposableStore() }) - - disposables.add(window.onDidLayout(dimension => this.handleContainerDidLayout(window.container, dimension))) - disposables.add(toDisposable(() => this._onDidRemoveContainer.fire(window.container))) - })) - } - - private handleContainerDidLayout (container: HTMLElement, dimension: dom.IDimension): void { + this._register( + this.auxiliaryWindowService.onDidOpenAuxiliaryWindow(({ window, disposables }) => { + this._onDidAddContainer.fire({ + container: window.container, + disposables: new DisposableStore() + }) + + disposables.add( + window.onDidLayout((dimension) => + this.handleContainerDidLayout(window.container, dimension) + ) + ) + disposables.add(toDisposable(() => this._onDidRemoveContainer.fire(window.container))) + }) + ) + } + + private handleContainerDidLayout(container: HTMLElement, dimension: dom.IDimension): void { if (container === this.mainContainer) { this._onDidLayoutMainContainer.fire(dimension) } @@ -192,13 +243,13 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe } } - private getActiveContainerId (): number { + private getActiveContainerId(): number { const activeContainer = this.activeContainer return dom.getWindow(activeContainer).vscodeWindowId } - private onActiveWindowChanged (): void { + private onActiveWindowChanged(): void { const activeContainerId = this.getActiveContainerId() if (this.activeContainerId !== activeContainerId) { this.activeContainerId = activeContainerId @@ -206,31 +257,40 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe } } - private isActivityBarHidden (): boolean { - const oldValue = this.configurationService.getValue('workbench.activityBar.visible') + private isActivityBarHidden(): boolean { + const oldValue = this.configurationService.getValue( + 'workbench.activityBar.visible' + ) if (oldValue !== undefined) { return !oldValue } - return this.configurationService.getValue(LayoutSettings.ACTIVITY_BAR_LOCATION) !== ActivityBarPosition.DEFAULT + return ( + this.configurationService.getValue(LayoutSettings.ACTIVITY_BAR_LOCATION) !== + ActivityBarPosition.DEFAULT + ) } - focusPart (part: Parts): void { + focusPart(part: Parts): void { switch (part) { case Parts.EDITOR_PART: this.editorGroupService.activeGroup.focus() break case Parts.PANEL_PART: { - const activePanel = this.paneCompositeService.getActivePaneComposite(ViewContainerLocation.Panel) + const activePanel = this.paneCompositeService.getActivePaneComposite( + ViewContainerLocation.Panel + ) activePanel?.focus() break } case Parts.SIDEBAR_PART: { - const activeViewlet = this.paneCompositeService.getActivePaneComposite(ViewContainerLocation.Sidebar) + const activeViewlet = this.paneCompositeService.getActivePaneComposite( + ViewContainerLocation.Sidebar + ) activeViewlet?.focus() break } case Parts.ACTIVITYBAR_PART: - (this.getPart(Parts.ACTIVITYBAR_PART) as ActivitybarPart).focus() + ;(this.getPart(Parts.ACTIVITYBAR_PART) as ActivitybarPart).focus() break case Parts.STATUSBAR_PART: this.statusBarService.focus() @@ -243,14 +303,13 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe } } - getDimension (part: Parts): dom.Dimension | undefined { + getDimension(part: Parts): dom.Dimension | undefined { return this.getPart(part)?.dimension } - toggleMaximizedPanel (): void { - } + toggleMaximizedPanel(): void {} - toggleMenuBar (): void { + toggleMenuBar(): void { let currentVisibilityValue = getMenuBarVisibility(this.configurationService) if (typeof currentVisibilityValue !== 'string') { currentVisibilityValue = 'classic' @@ -258,7 +317,8 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe let newVisibilityValue: string if (currentVisibilityValue === 'visible' || currentVisibilityValue === 'classic') { - newVisibilityValue = getTitleBarStyle(this.configurationService) === 'native' ? 'toggle' : 'compact' + newVisibilityValue = + getTitleBarStyle(this.configurationService) === 'native' ? 'toggle' : 'compact' } else { newVisibilityValue = 'classic' } @@ -266,7 +326,7 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe void this.configurationService.updateValue('window.menuBarVisibility', newVisibilityValue) } - setPanelPosition (position: Position): void { + setPanelPosition(position: Position): void { this.panelPosition = position const panelPart = this.getPart(Parts.PANEL_PART) @@ -276,51 +336,46 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe this._onDidChangePanelPosition.fire(positionToString(position)) } - getPanelAlignment (): PanelAlignment { + getPanelAlignment(): PanelAlignment { return 'left' } - setPanelAlignment (): void { - } + setPanelAlignment(): void {} - toggleZenMode (): void { - } + toggleZenMode(): void {} - isEditorLayoutCentered (): boolean { + isEditorLayoutCentered(): boolean { return false } - centerEditorLayout (): void { - } + centerEditorLayout(): void {} - resizePart (): void { - } + resizePart(): void {} - isWindowMaximized (): boolean { + isWindowMaximized(): boolean { return false } - updateWindowMaximizedState (): void { - } + updateWindowMaximizedState(): void {} - getVisibleNeighborPart (): Parts | undefined { + getVisibleNeighborPart(): Parts | undefined { return undefined } - getMaximumEditorDimensions (): dom.Dimension { + getMaximumEditorDimensions(): dom.Dimension { return new dom.Dimension(Infinity, Infinity) } - isPanelMaximized (): boolean { + isPanelMaximized(): boolean { return false } - getPanelPosition (): Position { + getPanelPosition(): Position { return this.panelPosition } private readonly parts = new Map() - hasFocus (part: Parts): boolean { + hasFocus(part: Parts): boolean { const activeElement = document.activeElement if (activeElement == null) { return false @@ -333,7 +388,7 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe getContainer(window: Window): HTMLElement getContainer(part: Parts): HTMLElement | undefined - getContainer (windowOrPart: Parts | Window): HTMLElement | undefined { + getContainer(windowOrPart: Parts | Window): HTMLElement | undefined { if (typeof windowOrPart === 'string') { if (this.parts.get(windowOrPart) == null) { return undefined @@ -346,24 +401,28 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe return this.mainContainer } else { // auxiliary window - return windowOrPart.document.body.getElementsByClassName('monaco-workbench')[0] as HTMLElement + return windowOrPart.document.body.getElementsByClassName( + 'monaco-workbench' + )[0] as HTMLElement } } } - public getPart (key: Parts): Part | undefined { + public getPart(key: Parts): Part | undefined { return this.parts.get(key) } private hiddenParts = new Set() - private hasViews (id: string): boolean { + private hasViews(id: string): boolean { const viewContainer = this.viewDescriptorService.getViewContainerById(id) if (viewContainer == null) { return false } - const viewContainerModel = this.viewDescriptorService.getViewContainerModel(viewContainer) as IViewContainerModel | undefined + const viewContainerModel = this.viewDescriptorService.getViewContainerModel(viewContainer) as + | IViewContainerModel + | undefined if (viewContainerModel == null) { return false } @@ -371,7 +430,7 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe return viewContainerModel.activeViewDescriptors.length >= 1 } - setPartHidden (hidden: boolean, part: Parts): void { + setPartHidden(hidden: boolean, part: Parts): void { if (hidden) { this.hiddenParts.add(part) } else { @@ -391,14 +450,16 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe this.paneCompositeService.hideActivePaneComposite(location) } else if (paneComposite == null && !hidden) { // If panel part becomes visible, show last active panel or default panel - let panelToOpen = this.paneCompositeService.getLastActivePaneCompositeId(location) as string | undefined + let panelToOpen = this.paneCompositeService.getLastActivePaneCompositeId(location) as + | string + | undefined // verify that the panel we try to open has views before we default to it // otherwise fall back to any view that has views still refs #111463 if (panelToOpen == null || !this.hasViews(panelToOpen)) { panelToOpen = this.viewDescriptorService .getViewContainersByLocation(location) - .find(viewContainer => this.hasViews(viewContainer.id))?.id + .find((viewContainer) => this.hasViews(viewContainer.id))?.id } if (panelToOpen != null) { @@ -411,15 +472,15 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe this.getPart(part)?.setVisible(!hidden) } - isVisible (part: Parts): boolean { + isVisible(part: Parts): boolean { return !this.hiddenParts.has(part) } - getSideBarPosition (): Position { + getSideBarPosition(): Position { return this.sideBarPosition } - setSideBarPosition (position: Position): void { + setSideBarPosition(position: Position): void { this.sideBarPosition = position const activityBar = this.getPart(Parts.ACTIVITYBAR_PART) @@ -434,14 +495,14 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe this._onDidChangeSideBarPosition.fire(positionToString(position)) } - registerPart (part: Part): IDisposable { + registerPart(part: Part): IDisposable { const id = part.getId() this.parts.set(id, part) return toDisposable(() => this.parts.delete(id)) } - isRestored (): boolean { + isRestored(): boolean { return true } @@ -454,8 +515,11 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe readonly onDidLayout = this._onDidLayout.event private _mainContainerDimension!: dom.IDimension - get mainContainerDimension (): dom.IDimension { return this._mainContainerDimension } - get activeContainerDimension (): dom.IDimension { + get mainContainerDimension(): dom.IDimension { + return this._mainContainerDimension + } + + get activeContainerDimension(): dom.IDimension { const activeContainer = this.activeContainer if (activeContainer === this.mainContainer) { // main window @@ -466,17 +530,17 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe } } - layout (): void { + layout(): void { this._mainContainerDimension = dom.getClientArea(window.document.body) this._onDidLayout.fire(this._mainContainerDimension) } - get hasContainer (): boolean { + get hasContainer(): boolean { return true } - focus (): void { + focus(): void { const activeContainer = this.activeContainer if (activeContainer === this.mainContainer) { // main window @@ -502,13 +566,13 @@ onRenderWorkbench((accessor) => { } }) -function getServiceOverride (): IEditorOverrideServices +function getServiceOverride(): IEditorOverrideServices /** * @deprecated Provide container via the services `initialize` function */ -function getServiceOverride (container?: HTMLElement): IEditorOverrideServices +function getServiceOverride(container?: HTMLElement): IEditorOverrideServices -function getServiceOverride (container?: HTMLElement): IEditorOverrideServices { +function getServiceOverride(container?: HTMLElement): IEditorOverrideServices { return { [ILayoutService.toString()]: new SyncDescriptor(LayoutService, [container], true) } diff --git a/src/service-override/lifecycle.ts b/src/service-override/lifecycle.ts index ae13e3be..0bd21203 100644 --- a/src/service-override/lifecycle.ts +++ b/src/service-override/lifecycle.ts @@ -5,7 +5,7 @@ import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecy import { TimerService } from 'vs/workbench/services/timer/browser/timerService' import { ITimerService } from 'vs/workbench/services/timer/browser/timerService.service' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ILifecycleService.toString()]: new SyncDescriptor(BrowserLifecycleService), [ITimerService.toString()]: new SyncDescriptor(TimerService) diff --git a/src/service-override/localization.ts b/src/service-override/localization.ts index 181af1b0..59b6e10a 100644 --- a/src/service-override/localization.ts +++ b/src/service-override/localization.ts @@ -1,6 +1,9 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { ILanguagePackItem, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks' +import { + ILanguagePackItem, + LanguagePackBaseService +} from 'vs/platform/languagePacks/common/languagePacks' import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks.service' import { ILocaleService } from 'vs/workbench/services/localization/common/locale.service' import { IDialogService } from 'vs/platform/dialogs/common/dialogs.service' @@ -18,13 +21,13 @@ export interface AvailableLanguage { } export interface LocalizationOptions { - setLocale (id: string): Promise + setLocale(id: string): Promise clearLocale(): Promise availableLanguages: AvailableLanguage[] } class LocaleService extends AbstractLocaleService { - constructor ( + constructor( private options: LocalizationOptions, @IDialogService dialogService: IDialogService, @IHostService hostService: IHostService, @@ -33,7 +36,7 @@ class LocaleService extends AbstractLocaleService { super(dialogService, hostService, productService) } - override async storeLocale (locale: string | undefined): Promise { + override async storeLocale(locale: string | undefined): Promise { if (locale == null) { await this.options.clearLocale() } else { @@ -41,37 +44,37 @@ class LocaleService extends AbstractLocaleService { } } - override async clearLocale (): Promise { + override async clearLocale(): Promise { await this.options.clearLocale() } } class LanguagePackService extends LanguagePackBaseService implements ILanguagePackService { - constructor ( + constructor( private options: LocalizationOptions, @IExtensionGalleryService extensionGalleryService: IExtensionGalleryService ) { super(extensionGalleryService) - setAvailableLocales(new Set(options.availableLanguages.map(lang => lang.locale))) + setAvailableLocales(new Set(options.availableLanguages.map((lang) => lang.locale))) } - override async getAvailableLanguages (): Promise { + override async getAvailableLanguages(): Promise { return this.options.availableLanguages.map(({ locale, languageName }) => { return this.createQuickPickItem(locale, languageName) }) } - async getInstalledLanguages (): Promise { + async getInstalledLanguages(): Promise { return [] } - async getBuiltInExtensionTranslationsUri (id: string, language: string): Promise { + async getBuiltInExtensionTranslationsUri(id: string, language: string): Promise { const uri = getBuiltInExtensionTranslationsUris(language)?.[id] return uri != null ? URI.parse(uri) : undefined } } -export default function getServiceOverride (options: LocalizationOptions): IEditorOverrideServices { +export default function getServiceOverride(options: LocalizationOptions): IEditorOverrideServices { return { [ILocaleService.toString()]: new SyncDescriptor(LocaleService, [options], true), // maybe custom impl [ILanguagePackService.toString()]: new SyncDescriptor(LanguagePackService, [options], true) diff --git a/src/service-override/log.ts b/src/service-override/log.ts index 5bc729a6..e248085e 100644 --- a/src/service-override/log.ts +++ b/src/service-override/log.ts @@ -18,26 +18,36 @@ import { rendererLogLabel } from '../override/vs/workbench/browser/web.main' import 'vs/workbench/contrib/logs/common/logs.contribution' class _FileLoggerService extends FileLoggerService { - constructor (logLevel: LogLevel | undefined, @IFileService fileService: IFileService, @IEnvironmentService environmentService: IEnvironmentService) { + constructor( + logLevel: LogLevel | undefined, + @IFileService fileService: IFileService, + @IEnvironmentService environmentService: IEnvironmentService + ) { super(logLevel ?? getLogLevel(environmentService), logsPath, fileService) } } const otherLoggers: ILogger[] = [] class _LogService extends LogService { - constructor (@ILoggerService loggerService: ILoggerService, @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService) { - const logger = loggerService.createLogger(environmentService.logFile, { id: windowLogId, name: rendererLogLabel }) + constructor( + @ILoggerService loggerService: ILoggerService, + @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService + ) { + const logger = loggerService.createLogger(environmentService.logFile, { + id: windowLogId, + name: rendererLogLabel + }) super(logger, otherLoggers) } } -function getServiceOverride (): IEditorOverrideServices +function getServiceOverride(): IEditorOverrideServices /** * @deprecated Provide logLevel via the services `initialize` function `configuration.developmentOptions.logLevel` parameter */ -function getServiceOverride (logLevel?: LogLevel): IEditorOverrideServices +function getServiceOverride(logLevel?: LogLevel): IEditorOverrideServices -function getServiceOverride (logLevel?: LogLevel): IEditorOverrideServices { +function getServiceOverride(logLevel?: LogLevel): IEditorOverrideServices { return { ...getEnvironmentServiceOverride(), [ILoggerService.toString()]: new SyncDescriptor(_FileLoggerService, [logLevel], true), @@ -48,7 +58,7 @@ function getServiceOverride (logLevel?: LogLevel): IEditorOverrideServices { export default getServiceOverride -export function registerAdditionalLogger (logger: ILogger): IDisposable { +export function registerAdditionalLogger(logger: ILogger): IDisposable { checkServicesNotInitialized() otherLoggers.push(logger) @@ -60,7 +70,4 @@ export function registerAdditionalLogger (logger: ILogger): IDisposable { }) } -export { - ILogger, - ConsoleLogger -} +export { ILogger, ConsoleLogger } diff --git a/src/service-override/markers.ts b/src/service-override/markers.ts index 9508acb0..bdf6c425 100644 --- a/src/service-override/markers.ts +++ b/src/service-override/markers.ts @@ -1,7 +1,6 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import 'vs/workbench/contrib/markers/browser/markers.contribution' -export default function getServiceOverride (): IEditorOverrideServices { - return { - } +export default function getServiceOverride(): IEditorOverrideServices { + return {} } diff --git a/src/service-override/model.ts b/src/service-override/model.ts index 015ac4af..5511f7a2 100644 --- a/src/service-override/model.ts +++ b/src/service-override/model.ts @@ -3,7 +3,7 @@ import { ITextModelService } from 'vs/editor/common/services/resolverService' import { TextModelResolverService } from 'vs/workbench/services/textmodelResolver/common/textModelResolverService' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ITextModelService.toString()]: new SyncDescriptor(TextModelResolverService, [], true) } diff --git a/src/service-override/monarch.ts b/src/service-override/monarch.ts index 9a326e36..49ee81b6 100644 --- a/src/service-override/monarch.ts +++ b/src/service-override/monarch.ts @@ -2,7 +2,6 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standalone import 'vs/editor/standalone/browser/inspectTokens/inspectTokens' import 'vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast' -export default function getServiceOverride (): IEditorOverrideServices { - return { - } +export default function getServiceOverride(): IEditorOverrideServices { + return {} } diff --git a/src/service-override/multiDiffEditor.ts b/src/service-override/multiDiffEditor.ts index 5893b239..efdb4870 100644 --- a/src/service-override/multiDiffEditor.ts +++ b/src/service-override/multiDiffEditor.ts @@ -4,8 +4,12 @@ import { MultiDiffSourceResolverService } from 'vs/workbench/contrib/multiDiffEd import { IMultiDiffSourceResolverService } from 'vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service' import 'vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditor.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { - [IMultiDiffSourceResolverService.toString()]: new SyncDescriptor(MultiDiffSourceResolverService, [], true) + [IMultiDiffSourceResolverService.toString()]: new SyncDescriptor( + MultiDiffSourceResolverService, + [], + true + ) } } diff --git a/src/service-override/notebook.ts b/src/service-override/notebook.ts index cdaa9ca8..e37272b5 100644 --- a/src/service-override/notebook.ts +++ b/src/service-override/notebook.ts @@ -10,7 +10,10 @@ import { NotebookCellStatusBarService } from 'vs/workbench/contrib/notebook/brow import { INotebookEditorService } from 'vs/workbench/contrib/notebook/browser/services/notebookEditorService.service' import { NotebookEditorWidgetService } from 'vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl' import { NotebookModelResolverServiceImpl } from 'vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl' -import { INotebookKernelHistoryService, INotebookKernelService } from 'vs/workbench/contrib/notebook/common/notebookKernelService.service' +import { + INotebookKernelHistoryService, + INotebookKernelService +} from 'vs/workbench/contrib/notebook/common/notebookKernelService.service' import { NotebookKernelService } from 'vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl' import { NotebookRendererMessagingService } from 'vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl' import { INotebookRendererMessagingService } from 'vs/workbench/contrib/notebook/common/notebookRendererMessagingService.service' @@ -29,21 +32,49 @@ import { NotebookDocumentWorkbenchService } from 'vs/workbench/services/notebook import { INotebookDocumentService } from 'vs/workbench/services/notebook/common/notebookDocumentService.service' import 'vs/workbench/contrib/notebook/browser/notebook.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [INotebookService.toString()]: new SyncDescriptor(NotebookService, [], true), - [INotebookEditorWorkerService.toString()]: new SyncDescriptor(NotebookEditorWorkerServiceImpl, [], true), - [INotebookEditorModelResolverService.toString()]: new SyncDescriptor(NotebookModelResolverServiceImpl, [], true), - [INotebookCellStatusBarService.toString()]: new SyncDescriptor(NotebookCellStatusBarService, [], true), + [INotebookEditorWorkerService.toString()]: new SyncDescriptor( + NotebookEditorWorkerServiceImpl, + [], + true + ), + [INotebookEditorModelResolverService.toString()]: new SyncDescriptor( + NotebookModelResolverServiceImpl, + [], + true + ), + [INotebookCellStatusBarService.toString()]: new SyncDescriptor( + NotebookCellStatusBarService, + [], + true + ), [INotebookEditorService.toString()]: new SyncDescriptor(NotebookEditorWidgetService, [], true), [INotebookKernelService.toString()]: new SyncDescriptor(NotebookKernelService, [], true), - [INotebookKernelHistoryService.toString()]: new SyncDescriptor(NotebookKernelHistoryService, [], true), + [INotebookKernelHistoryService.toString()]: new SyncDescriptor( + NotebookKernelHistoryService, + [], + true + ), [INotebookExecutionService.toString()]: new SyncDescriptor(NotebookExecutionService, [], true), - [INotebookExecutionStateService.toString()]: new SyncDescriptor(NotebookExecutionStateService, [], true), - [INotebookRendererMessagingService.toString()]: new SyncDescriptor(NotebookRendererMessagingService, [], true), + [INotebookExecutionStateService.toString()]: new SyncDescriptor( + NotebookExecutionStateService, + [], + true + ), + [INotebookRendererMessagingService.toString()]: new SyncDescriptor( + NotebookRendererMessagingService, + [], + true + ), [INotebookKeymapService.toString()]: new SyncDescriptor(NotebookKeymapService, [], true), [INotebookLoggingService.toString()]: new SyncDescriptor(NotebookLoggingService, [], true), [INotebookSearchService.toString()]: new SyncDescriptor(NotebookSearchService, [], true), - [INotebookDocumentService.toString()]: new SyncDescriptor(NotebookDocumentWorkbenchService, [], true) + [INotebookDocumentService.toString()]: new SyncDescriptor( + NotebookDocumentWorkbenchService, + [], + true + ) } } diff --git a/src/service-override/notifications.ts b/src/service-override/notifications.ts index 34a07061..27c4395b 100644 --- a/src/service-override/notifications.ts +++ b/src/service-override/notifications.ts @@ -20,8 +20,16 @@ onRenderWorkbench(async (accessor) => { // Instantiate Notification components setTimeout(() => { - const notificationsCenter = instantiationService.createInstance(NotificationsCenter, container, model) - const notificationsToasts = instantiationService.createInstance(NotificationsToasts, container, model) + const notificationsCenter = instantiationService.createInstance( + NotificationsCenter, + container, + model + ) + const notificationsToasts = instantiationService.createInstance( + NotificationsToasts, + container, + model + ) instantiationService.createInstance(NotificationsAlerts, model) const notificationsStatus = instantiationService.createInstance(NotificationsStatus, model) instantiationService.createInstance(NotificationsTelemetry) @@ -42,7 +50,7 @@ onRenderWorkbench(async (accessor) => { }) }) -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [INotificationService.toString()]: new SyncDescriptor(NotificationService, [], true) } diff --git a/src/service-override/outline.ts b/src/service-override/outline.ts index 29acbe7f..26131e13 100644 --- a/src/service-override/outline.ts +++ b/src/service-override/outline.ts @@ -5,7 +5,7 @@ import 'vs/workbench/contrib/outline/browser/outline.contribution' import { IOutlineService } from 'vs/workbench/services/outline/browser/outline.service' import { OutlineService } from 'vs/workbench/services/outline/browser/outlineService' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IOutlineService.toString()]: new SyncDescriptor(OutlineService, [], true) } diff --git a/src/service-override/output.ts b/src/service-override/output.ts index 91e3035c..e8d79330 100644 --- a/src/service-override/output.ts +++ b/src/service-override/output.ts @@ -8,13 +8,13 @@ import { IOutputChannelModelService } from 'vs/workbench/contrib/output/common/o import getLogServiceOverride from './log' import 'vs/workbench/contrib/output/browser/output.contribution' -function getServiceOverride (): IEditorOverrideServices +function getServiceOverride(): IEditorOverrideServices /** * @deprecated Provide logLevel via the services `initialize` function `configuration.developmentOptions.logLevel` parameter */ -function getServiceOverride (logLevel?: LogLevel): IEditorOverrideServices +function getServiceOverride(logLevel?: LogLevel): IEditorOverrideServices -function getServiceOverride (logLevel?: LogLevel): IEditorOverrideServices { +function getServiceOverride(logLevel?: LogLevel): IEditorOverrideServices { return { ...getLogServiceOverride(logLevel), [IOutputService.toString()]: new SyncDescriptor(OutputService, [], true), diff --git a/src/service-override/performance.ts b/src/service-override/performance.ts index 229e601f..5cf1bbd1 100644 --- a/src/service-override/performance.ts +++ b/src/service-override/performance.ts @@ -2,7 +2,6 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standalone import 'vs/workbench/contrib/performance/browser/performance.contribution' import 'vs/workbench/contrib/performance/browser/performance.web.contribution' -export default function getServiceOverride (): IEditorOverrideServices { - return { - } +export default function getServiceOverride(): IEditorOverrideServices { + return {} } diff --git a/src/service-override/preferences.ts b/src/service-override/preferences.ts index 79bc2007..872e25cd 100644 --- a/src/service-override/preferences.ts +++ b/src/service-override/preferences.ts @@ -8,7 +8,7 @@ import { KeybindingsEditingService } from 'vs/workbench/services/keybinding/comm import { IKeybindingEditingService } from 'vs/workbench/services/keybinding/common/keybindingEditing.service' import 'vs/workbench/contrib/preferences/browser/preferences.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IPreferencesService.toString()]: new SyncDescriptor(PreferencesService, [], true), [IPreferencesSearchService.toString()]: new SyncDescriptor(PreferencesSearchService, [], true), diff --git a/src/service-override/quickaccess.ts b/src/service-override/quickaccess.ts index 229d7969..d0c774ea 100644 --- a/src/service-override/quickaccess.ts +++ b/src/service-override/quickaccess.ts @@ -1,9 +1,23 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput.service' -import { IInputBox, IInputOptions, IPickOptions, IQuickInput, IQuickInputButton, IQuickNavigateConfiguration, IQuickPick, IQuickPickItem, IQuickWidget, QuickPickInput } from 'vs/platform/quickinput/common/quickInput' +import { + IInputBox, + IInputOptions, + IPickOptions, + IQuickInput, + IQuickInputButton, + IQuickNavigateConfiguration, + IQuickPick, + IQuickPickItem, + IQuickWidget, + QuickPickInput +} from 'vs/platform/quickinput/common/quickInput' import { CancellationToken } from 'vs/base/common/cancellation' import { StandaloneQuickInputService } from 'vs/editor/standalone/browser/quickInput/standaloneQuickInputService' -import { IEditorOverrideServices, StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices' +import { + IEditorOverrideServices, + StandaloneServices +} from 'vs/editor/standalone/browser/standaloneServices' import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' import { QuickInputController } from 'vs/platform/quickinput/browser/quickInputController' import { IQuickAccessController } from 'vs/platform/quickinput/common/quickAccess' @@ -23,17 +37,23 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser' let isKeybindingConfigurationVisible = () => { return false } -let shouldUseGlobalPicker = (_activeCodeEditor: ICodeEditor, _activeCodeEditorStandalone: boolean) => { +let shouldUseGlobalPicker = ( + _activeCodeEditor: ICodeEditor, + _activeCodeEditorStandalone: boolean +) => { return false } // eslint-disable-next-line dot-notation const original = CommandsQuickAccessProvider.prototype['getCommandPicks'] // eslint-disable-next-line dot-notation -CommandsQuickAccessProvider.prototype['getCommandPicks'] = async function (this: CommandsQuickAccessProvider, token: CancellationToken) { +CommandsQuickAccessProvider.prototype['getCommandPicks'] = async function ( + this: CommandsQuickAccessProvider, + token: CancellationToken +) { let result = await original.call(this, token) if (!isKeybindingConfigurationVisible()) { - result = result.map(picks => ({ + result = result.map((picks) => ({ ...picks, buttons: undefined })) @@ -46,85 +66,118 @@ class DelegateQuickInputService implements IQuickInputService { private workbenchQuickInputService: IQuickInputService private standaloneQuickInputService?: StandaloneQuickInputService - constructor ( - @IInstantiationService private instantiationService: IInstantiationService - ) { + constructor(@IInstantiationService private instantiationService: IInstantiationService) { this.workbenchQuickInputService = instantiationService.createInstance(QuickInputService) } - private get activeService (): IQuickInputService { + private get activeService(): IQuickInputService { const activeCodeEditor = StandaloneServices.get(ICodeEditorService).getFocusedCodeEditor() - if (activeCodeEditor == null || shouldUseGlobalPicker(activeCodeEditor, activeCodeEditor instanceof StandaloneCodeEditor)) { + if ( + activeCodeEditor == null || + shouldUseGlobalPicker(activeCodeEditor, activeCodeEditor instanceof StandaloneCodeEditor) + ) { return this.workbenchQuickInputService } - this.standaloneQuickInputService ??= this.instantiationService.createInstance(StandaloneQuickInputService) + this.standaloneQuickInputService ??= this.instantiationService.createInstance( + StandaloneQuickInputService + ) return this.standaloneQuickInputService } - get currentQuickInput (): IQuickInput | undefined { return this.activeService.currentQuickInput } + get currentQuickInput(): IQuickInput | undefined { + return this.activeService.currentQuickInput + } + + get quickAccess(): IQuickAccessController { + return this.activeService.quickAccess + } - get quickAccess (): IQuickAccessController { return this.activeService.quickAccess } + get backButton(): IQuickInputButton { + return this.activeService.backButton + } - get backButton (): IQuickInputButton { return this.activeService.backButton } + get onShow() { + return this.activeService.onShow + } - get onShow () { return this.activeService.onShow } - get onHide () { return this.activeService.onHide } + get onHide() { + return this.activeService.onHide + } - createQuickWidget (): IQuickWidget { + createQuickWidget(): IQuickWidget { return this.activeService.createQuickWidget() } - pick> (picks: Promise[]> | QuickPickInput[], options: O = {}, token: CancellationToken = CancellationToken.None): Promise<(O extends { canPickMany: true } ? T[] : T) | undefined> { - return (this.activeService as unknown as QuickInputController /* TS fail */).pick(picks, options, token) + pick>( + picks: Promise[]> | QuickPickInput[], + options: O = {}, + token: CancellationToken = CancellationToken.None + ): Promise<(O extends { canPickMany: true } ? T[] : T) | undefined> { + return (this.activeService as unknown as QuickInputController) /* TS fail */ + .pick(picks, options, token) } - input (options?: IInputOptions | undefined, token?: CancellationToken | undefined): Promise { + input( + options?: IInputOptions | undefined, + token?: CancellationToken | undefined + ): Promise { return this.activeService.input(options, token) } - createQuickPick(options: { useSeparators: true }): IQuickPick - createQuickPick(options?: { useSeparators: boolean }): IQuickPick - createQuickPick (options: { useSeparators: boolean } = { useSeparators: false }): IQuickPick { + createQuickPick(options: { + useSeparators: true + }): IQuickPick + + createQuickPick(options?: { + useSeparators: boolean + }): IQuickPick + + createQuickPick( + options: { useSeparators: boolean } = { useSeparators: false } + ): IQuickPick { return this.activeService.createQuickPick(options) } - createInputBox (): IInputBox { + createInputBox(): IInputBox { return this.activeService.createInputBox() } - focus (): void { + focus(): void { return this.activeService.focus() } - toggle (): void { + toggle(): void { return this.activeService.toggle() } - navigate (next: boolean, quickNavigate?: IQuickNavigateConfiguration | undefined): void { + navigate(next: boolean, quickNavigate?: IQuickNavigateConfiguration | undefined): void { return this.activeService.navigate(next, quickNavigate) } - accept (): Promise { + accept(): Promise { return this.activeService.accept() } - back (): Promise { + back(): Promise { return this.activeService.back() } - cancel (): Promise { + cancel(): Promise { return this.activeService.cancel() } } interface QuickAccessProps { isKeybindingConfigurationVisible?: () => boolean - shouldUseGlobalPicker?: (activeCodeEditor: ICodeEditor | null, activeCodeEditorStandalone: boolean) => boolean + shouldUseGlobalPicker?: ( + activeCodeEditor: ICodeEditor | null, + activeCodeEditorStandalone: boolean + ) => boolean } -export default function getServiceOverride ({ +export default function getServiceOverride({ isKeybindingConfigurationVisible: _isKeybindingConfigurationVisible, shouldUseGlobalPicker: _shouldUseGlobalPicker }: QuickAccessProps = {}): IEditorOverrideServices { diff --git a/src/service-override/relauncher.ts b/src/service-override/relauncher.ts index 49b807f5..767ff069 100644 --- a/src/service-override/relauncher.ts +++ b/src/service-override/relauncher.ts @@ -1,7 +1,6 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import 'vs/workbench/contrib/relauncher/browser/relauncher.contribution' -export default function getServiceOverride (): IEditorOverrideServices { - return { - } +export default function getServiceOverride(): IEditorOverrideServices { + return {} } diff --git a/src/service-override/remoteAgent.ts b/src/service-override/remoteAgent.ts index 7a134e3e..613504c9 100644 --- a/src/service-override/remoteAgent.ts +++ b/src/service-override/remoteAgent.ts @@ -38,14 +38,20 @@ import 'vs/workbench/contrib/remote/browser/remote.contribution' import 'vs/workbench/contrib/remote/browser/remoteStartEntry.contribution' class CustomRemoteSocketFactoryService extends RemoteSocketFactoryService { - constructor (@IBrowserWorkbenchEnvironmentService browserWorkbenchEnvironmentService: IBrowserWorkbenchEnvironmentService) { + constructor( + @IBrowserWorkbenchEnvironmentService + browserWorkbenchEnvironmentService: IBrowserWorkbenchEnvironmentService + ) { super() - this.register(RemoteConnectionType.WebSocket, new BrowserSocketFactory(browserWorkbenchEnvironmentService.options?.webSocketFactory)) + this.register( + RemoteConnectionType.WebSocket, + new BrowserSocketFactory(browserWorkbenchEnvironmentService.options?.webSocketFactory) + ) } } class InjectedRemoteAuthorityResolverService extends RemoteAuthorityResolverService { - constructor ( + constructor( @IEnvironmentService environmentService: BrowserWorkbenchEnvironmentService, @IProductService productService: IProductService, @ILogService logService: ILogService, @@ -53,27 +59,47 @@ class InjectedRemoteAuthorityResolverService extends RemoteAuthorityResolverServ ) { const configuration = getWorkbenchConstructionOptions() const connectionToken = environmentService.options.connectionToken - const remoteResourceLoader = configuration.remoteResourceProvider != null ? new BrowserRemoteResourceLoader(fileService, configuration.remoteResourceProvider) : undefined - const resourceUriProvider = configuration.resourceUriProvider ?? remoteResourceLoader?.getResourceUriProvider() - super(!environmentService.expectsResolverExtension, connectionToken, resourceUriProvider, configuration.serverBasePath, productService, logService) + const remoteResourceLoader = + configuration.remoteResourceProvider != null + ? new BrowserRemoteResourceLoader(fileService, configuration.remoteResourceProvider) + : undefined + const resourceUriProvider = + configuration.resourceUriProvider ?? remoteResourceLoader?.getResourceUriProvider() + super( + !environmentService.expectsResolverExtension, + connectionToken, + resourceUriProvider, + configuration.serverBasePath, + productService, + logService + ) } } class CustomRemoteExtensionsScannerService extends RemoteExtensionsScannerService { - constructor ( + constructor( private scanRemoteExtensions: boolean, @IRemoteAgentService remoteAgentService: IRemoteAgentService, @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, @IUserDataProfileService userDataProfileService: IUserDataProfileService, @IRemoteUserDataProfilesService remoteUserDataProfilesService: IRemoteUserDataProfilesService, @IActiveLanguagePackService activeLanguagePackService: IActiveLanguagePackService, - @IWorkbenchExtensionManagementService extensionManagementService: IWorkbenchExtensionManagementService, + @IWorkbenchExtensionManagementService + extensionManagementService: IWorkbenchExtensionManagementService, @ILogService logService: ILogService ) { - super(remoteAgentService, environmentService, userDataProfileService, remoteUserDataProfilesService, activeLanguagePackService, extensionManagementService, logService) + super( + remoteAgentService, + environmentService, + userDataProfileService, + remoteUserDataProfilesService, + activeLanguagePackService, + extensionManagementService, + logService + ) } - override async scanExtensions (): Promise { + override async scanExtensions(): Promise { if (!this.scanRemoteExtensions) { return [] } @@ -82,7 +108,11 @@ class CustomRemoteExtensionsScannerService extends RemoteExtensionsScannerServic } registerServiceInitializePreParticipant(async (serviceAccessor) => { - RemoteFileSystemProviderClient.register(serviceAccessor.get(IRemoteAgentService), serviceAccessor.get(IFileService), serviceAccessor.get(ILogService)) + RemoteFileSystemProviderClient.register( + serviceAccessor.get(IRemoteAgentService), + serviceAccessor.get(IFileService), + serviceAccessor.get(ILogService) + ) }) export interface RemoteAgentServiceOverrideParams { @@ -93,15 +123,28 @@ export interface RemoteAgentServiceOverrideParams { scanRemoteExtensions?: boolean } -export default function getServiceOverride ({ scanRemoteExtensions = false }: RemoteAgentServiceOverrideParams = {}): IEditorOverrideServices { +export default function getServiceOverride({ + scanRemoteExtensions = false +}: RemoteAgentServiceOverrideParams = {}): IEditorOverrideServices { return { ...getEnvironmentServiceOverride(), [IRemoteAgentService.toString()]: new SyncDescriptor(RemoteAgentService, [], true), - [IRemoteSocketFactoryService.toString()]: new SyncDescriptor(CustomRemoteSocketFactoryService, [], true), - [IRemoteAuthorityResolverService.toString()]: new SyncDescriptor(InjectedRemoteAuthorityResolverService, []), + [IRemoteSocketFactoryService.toString()]: new SyncDescriptor( + CustomRemoteSocketFactoryService, + [], + true + ), + [IRemoteAuthorityResolverService.toString()]: new SyncDescriptor( + InjectedRemoteAuthorityResolverService, + [] + ), [IRemoteExplorerService.toString()]: new SyncDescriptor(RemoteExplorerService, [], true), [IExternalUriOpenerService.toString()]: new SyncDescriptor(ExternalUriOpenerService, [], true), - [IRemoteExtensionsScannerService.toString()]: new SyncDescriptor(CustomRemoteExtensionsScannerService, [scanRemoteExtensions], true), + [IRemoteExtensionsScannerService.toString()]: new SyncDescriptor( + CustomRemoteExtensionsScannerService, + [scanRemoteExtensions], + true + ), [ITunnelService.toString()]: new SyncDescriptor(TunnelService, [], true) } } diff --git a/src/service-override/scm.ts b/src/service-override/scm.ts index 17967f65..33477a6b 100644 --- a/src/service-override/scm.ts +++ b/src/service-override/scm.ts @@ -7,7 +7,7 @@ import { QuickDiffService } from 'vs/workbench/contrib/scm/common/quickDiffServi import 'vs/workbench/contrib/scm/browser/scm.contribution' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ISCMService.toString()]: new SyncDescriptor(SCMService, [], true), [ISCMViewService.toString()]: new SyncDescriptor(SCMViewService, [], true), diff --git a/src/service-override/search.ts b/src/service-override/search.ts index 63c26d52..1a06f2a4 100644 --- a/src/service-override/search.ts +++ b/src/service-override/search.ts @@ -24,14 +24,16 @@ import { Schemas } from 'vs/base/common/network' import { IFileSystemProvider } from 'vs/platform/files/common/files' import { HTMLFileSystemProvider } from 'vs/platform/files/browser/htmlFileSystemProvider' -function isHTMLFileSystemProvider (provider: IFileSystemProvider): provider is HTMLFileSystemProvider { +function isHTMLFileSystemProvider( + provider: IFileSystemProvider +): provider is HTMLFileSystemProvider { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition return (provider as HTMLFileSystemProvider).directories != null } // Duplicated from RemoteSearchService, with a check on the file system provider being an HTMLFileSystemProvider class CustomSearchService extends SearchService { - constructor ( + constructor( @IModelService modelService: IModelService, @IEditorService editorService: IEditorService, @ITelemetryService telemetryService: ITelemetryService, @@ -41,7 +43,15 @@ class CustomSearchService extends SearchService { @IInstantiationService private readonly instantiationService: IInstantiationService, @IUriIdentityService uriIdentityService: IUriIdentityService ) { - super(modelService, editorService, telemetryService, logService, extensionService, fileService, uriIdentityService) + super( + modelService, + editorService, + telemetryService, + logService, + extensionService, + fileService, + uriIdentityService + ) if (isHTMLFileSystemProvider(fileService.getProvider(Schemas.file)!)) { const searchProvider = this.instantiationService.createInstance(LocalFileSearchWorkerClient) this.registerSearchResultProvider(Schemas.file, SearchProviderType.file, searchProvider) @@ -50,10 +60,14 @@ class CustomSearchService extends SearchService { } } -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ISearchService.toString()]: new SyncDescriptor(CustomSearchService, [], true), - [ISearchViewModelWorkbenchService.toString()]: new SyncDescriptor(SearchViewModelWorkbenchService, [], true), + [ISearchViewModelWorkbenchService.toString()]: new SyncDescriptor( + SearchViewModelWorkbenchService, + [], + true + ), [ISearchHistoryService.toString()]: new SyncDescriptor(SearchHistoryService, [], true), [IReplaceService.toString()]: new SyncDescriptor(ReplaceService, [], true) } diff --git a/src/service-override/secretStorage.ts b/src/service-override/secretStorage.ts index 1d344c6f..42a73b1a 100644 --- a/src/service-override/secretStorage.ts +++ b/src/service-override/secretStorage.ts @@ -5,7 +5,7 @@ import { ISecretStorageService } from 'vs/platform/secrets/common/secrets.servic import { EncryptionService } from 'vs/workbench/services/encryption/browser/encryptionService' import { BrowserSecretStorageService } from 'vs/workbench/services/secrets/browser/secretStorageService' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ISecretStorageService.toString()]: new SyncDescriptor(BrowserSecretStorageService, [], true), [IEncryptionService.toString()]: new SyncDescriptor(EncryptionService, [], true) diff --git a/src/service-override/share.ts b/src/service-override/share.ts index 62f6219c..5e0b6397 100644 --- a/src/service-override/share.ts +++ b/src/service-override/share.ts @@ -4,7 +4,7 @@ import { ShareService } from 'vs/workbench/contrib/share/browser/shareService' import { IShareService } from 'vs/workbench/contrib/share/common/share.service' import 'vs/workbench/contrib/share/browser/share.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IShareService.toString()]: new SyncDescriptor(ShareService, [], true) } diff --git a/src/service-override/snippets.ts b/src/service-override/snippets.ts index 9b429d70..4ecb3a69 100644 --- a/src/service-override/snippets.ts +++ b/src/service-override/snippets.ts @@ -1,4 +1,7 @@ -import { IEditorOverrideServices, StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices' +import { + IEditorOverrideServices, + StandaloneServices +} from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { ISnippetsService } from 'vs/workbench/contrib/snippets/browser/snippets.service' import { SnippetsService } from 'vs/workbench/contrib/snippets/browser/snippetsService' @@ -14,19 +17,20 @@ interface ISnippetsExtensionPoint { } registerServiceInitializeParticipant(async (accessor) => { - void accessor.get(ILifecycleService).when(LifecyclePhase.Ready).then(() => { - // Force load the service - StandaloneServices.get(ISnippetsService) - }) + void accessor + .get(ILifecycleService) + .when(LifecyclePhase.Ready) + .then(() => { + // Force load the service + StandaloneServices.get(ISnippetsService) + }) }) -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { ...getFileServiceOverride(), [ISnippetsService.toString()]: new SyncDescriptor(SnippetsService, [], true) } } -export { - ISnippetsExtensionPoint -} +export { ISnippetsExtensionPoint } diff --git a/src/service-override/speech.ts b/src/service-override/speech.ts index 040450e6..4c65f5b1 100644 --- a/src/service-override/speech.ts +++ b/src/service-override/speech.ts @@ -4,7 +4,7 @@ import { ISpeechService } from 'vs/workbench/contrib/speech/common/speechService import { SpeechService } from 'vs/workbench/contrib/speech/browser/speechService' import 'vs/workbench/contrib/speech/browser/speech.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ISpeechService.toString()]: new SyncDescriptor(SpeechService, [], true) } diff --git a/src/service-override/storage.ts b/src/service-override/storage.ts index d070762e..4b4bc727 100644 --- a/src/service-override/storage.ts +++ b/src/service-override/storage.ts @@ -1,9 +1,18 @@ import { Event } from 'vs/base/common/event' import { IDisposable } from 'vs/base/common/lifecycle' -import { IStorage, IStorageDatabase, IStorageItemsChangeEvent, IUpdateRequest, Storage } from 'vs/base/parts/storage/common/storage' +import { + IStorage, + IStorageDatabase, + IStorageItemsChangeEvent, + IUpdateRequest, + Storage +} from 'vs/base/parts/storage/common/storage' import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { AbstractStorageService, StorageScope as VSStorageScope } from 'vs/platform/storage/common/storage' +import { + AbstractStorageService, + StorageScope as VSStorageScope +} from 'vs/platform/storage/common/storage' import { IStorageService } from 'vs/platform/storage/common/storage.service' import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile' import { IAnyWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace' @@ -13,7 +22,10 @@ import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/c import { IHostService } from 'vs/workbench/services/host/browser/host.service' import { ExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage' import { IExtensionStorageService } from 'vs/platform/extensionManagement/common/extensionStorage.service' -import { registerServiceInitializeParticipant, registerServiceInitializePreParticipant } from '../lifecycle' +import { + registerServiceInitializeParticipant, + registerServiceInitializePreParticipant +} from '../lifecycle' import { getWorkspaceIdentifier } from '../workbench' export enum StorageScope { @@ -23,18 +35,15 @@ export enum StorageScope { } export interface IStorageProvider { - read (scope: StorageScope): Map | undefined - write (scope: StorageScope, data: Map): Promise - close? (scope: StorageScope): Promise - onDidChange? (listener: (event: IStorageItemsChangeEvent) => void): IDisposable - optimize? (scope: StorageScope): Promise + read(scope: StorageScope): Map | undefined + write(scope: StorageScope, data: Map): Promise + close?(scope: StorageScope): Promise + onDidChange?(listener: (event: IStorageItemsChangeEvent) => void): IDisposable + optimize?(scope: StorageScope): Promise } class ExternalStorage extends Storage { - constructor ( - scope: StorageScope, - provider: IStorageProvider - ) { + constructor(scope: StorageScope, provider: IStorageProvider) { const items = provider.read(scope) super(new ExternalStorageDatabase(scope, provider, items)) @@ -50,7 +59,7 @@ class ExternalStorage extends Storage { class ExternalStorageDatabase implements IStorageDatabase { readonly onDidChangeItemsExternal: Event - constructor ( + constructor( private readonly scope: StorageScope, private readonly provider: IStorageProvider, private readonly items = new Map() @@ -58,43 +67,66 @@ class ExternalStorageDatabase implements IStorageDatabase { this.onDidChangeItemsExternal = this.provider.onDidChange ?? Event.None } - async getItems (): Promise> { + async getItems(): Promise> { return this.items } - async updateItems (request: IUpdateRequest): Promise { + async updateItems(request: IUpdateRequest): Promise { request.insert?.forEach((value, key) => this.items.set(key, value)) - request.delete?.forEach(key => this.items.delete(key)) + request.delete?.forEach((key) => this.items.delete(key)) await this.provider.write(this.scope, this.items) } - async close () { + async close() { return await this.provider.close?.(this.scope) } - async optimize (): Promise { + async optimize(): Promise { return await this.provider.optimize?.(this.scope) } } class ExternalStorageService extends AbstractStorageService { - private readonly applicationStorage = this._register(new ExternalStorage(StorageScope.APPLICATION, this.provider)) - private readonly profileStorage = this._register(new ExternalStorage(StorageScope.PROFILE, this.provider)) - private readonly workspaceStorage = this._register(new ExternalStorage(StorageScope.WORKSPACE, this.provider)) + private readonly applicationStorage = this._register( + new ExternalStorage(StorageScope.APPLICATION, this.provider) + ) + + private readonly profileStorage = this._register( + new ExternalStorage(StorageScope.PROFILE, this.provider) + ) - constructor (protected readonly provider: IStorageProvider, private fallbackOverride?: Record) { + private readonly workspaceStorage = this._register( + new ExternalStorage(StorageScope.WORKSPACE, this.provider) + ) + + constructor( + protected readonly provider: IStorageProvider, + private fallbackOverride?: Record + ) { super({ flushInterval: 5000 }) - this._register(this.workspaceStorage.onDidChangeStorage(key => this.emitDidChangeValue(VSStorageScope.WORKSPACE, key))) - this._register(this.profileStorage.onDidChangeStorage(key => this.emitDidChangeValue(VSStorageScope.PROFILE, key))) - this._register(this.applicationStorage.onDidChangeStorage(key => this.emitDidChangeValue(VSStorageScope.APPLICATION, key))) + this._register( + this.workspaceStorage.onDidChangeStorage((key) => + this.emitDidChangeValue(VSStorageScope.WORKSPACE, key) + ) + ) + this._register( + this.profileStorage.onDidChangeStorage((key) => + this.emitDidChangeValue(VSStorageScope.PROFILE, key) + ) + ) + this._register( + this.applicationStorage.onDidChangeStorage((key) => + this.emitDidChangeValue(VSStorageScope.APPLICATION, key) + ) + ) } - protected getStorage (scope: VSStorageScope): IStorage { + protected getStorage(scope: VSStorageScope): IStorage { switch (scope) { case VSStorageScope.APPLICATION: return this.applicationStorage @@ -105,7 +137,7 @@ class ExternalStorageService extends AbstractStorageService { } } - protected getLogDetails (scope: VSStorageScope): string | undefined { + protected getLogDetails(scope: VSStorageScope): string | undefined { switch (scope) { case VSStorageScope.APPLICATION: return 'External (application)' @@ -116,44 +148,68 @@ class ExternalStorageService extends AbstractStorageService { } } - protected async doInitialize (): Promise { + protected async doInitialize(): Promise { // no-op } - protected async switchToProfile (): Promise { + protected async switchToProfile(): Promise { // no-op } - protected async switchToWorkspace (): Promise { + protected async switchToWorkspace(): Promise { // no-op } - hasScope (_scope: IAnyWorkspaceIdentifier | IUserDataProfile): boolean { + hasScope(_scope: IAnyWorkspaceIdentifier | IUserDataProfile): boolean { return false } override get(key: string, scope: VSStorageScope, fallbackValue: string): string override get(key: string, scope: VSStorageScope): string | undefined - override get (key: string, scope: VSStorageScope, fallbackValue?: string): string | undefined { - return this.getStorage(scope).get(key, (this.fallbackOverride?.[key] as string | undefined) ?? fallbackValue) + override get(key: string, scope: VSStorageScope, fallbackValue?: string): string | undefined { + return this.getStorage(scope).get( + key, + (this.fallbackOverride?.[key] as string | undefined) ?? fallbackValue + ) } override getBoolean(key: string, scope: VSStorageScope, fallbackValue: boolean): boolean override getBoolean(key: string, scope: VSStorageScope): boolean | undefined - override getBoolean (key: string, scope: VSStorageScope, fallbackValue?: boolean): boolean | undefined { - return this.getStorage(scope).getBoolean(key, (this.fallbackOverride?.[key] as boolean | undefined) ?? fallbackValue) + override getBoolean( + key: string, + scope: VSStorageScope, + fallbackValue?: boolean + ): boolean | undefined { + return this.getStorage(scope).getBoolean( + key, + (this.fallbackOverride?.[key] as boolean | undefined) ?? fallbackValue + ) } override getNumber(key: string, scope: VSStorageScope, fallbackValue: number): number override getNumber(key: string, scope: VSStorageScope): number | undefined - override getNumber (key: string, scope: VSStorageScope, fallbackValue?: number): number | undefined { - return this.getStorage(scope).getNumber(key, (this.fallbackOverride?.[key] as number | undefined) ?? fallbackValue) + override getNumber( + key: string, + scope: VSStorageScope, + fallbackValue?: number + ): number | undefined { + return this.getStorage(scope).getNumber( + key, + (this.fallbackOverride?.[key] as number | undefined) ?? fallbackValue + ) } override getObject(key: string, scope: VSStorageScope, fallbackValue: object): object override getObject(key: string, scope: VSStorageScope): object | undefined - override getObject (key: string, scope: VSStorageScope, fallbackValue?: object): object | undefined { - return this.getStorage(scope).getObject(key, (this.fallbackOverride?.[key] as object | undefined) ?? fallbackValue) + override getObject( + key: string, + scope: VSStorageScope, + fallbackValue?: object + ): object | undefined { + return this.getStorage(scope).getObject( + key, + (this.fallbackOverride?.[key] as object | undefined) ?? fallbackValue + ) } } @@ -167,7 +223,7 @@ registerServiceInitializePreParticipant(async (accessor) => { registerServiceInitializeParticipant(async (accessor) => { const hostService = accessor.get(IHostService) const storageService = accessor.get(IStorageService) - hostService.onDidChangeFocus(focus => { + hostService.onDidChangeFocus((focus) => { if (!focus) { void storageService.flush() } @@ -175,7 +231,7 @@ registerServiceInitializeParticipant(async (accessor) => { }) class InjectedBrowserStorageService extends BrowserStorageService { - constructor ( + constructor( private fallbackOverride: Record | undefined, @IUserDataProfileService userDataProfileService: IUserDataProfileService, @ILogService logService: ILogService @@ -185,26 +241,50 @@ class InjectedBrowserStorageService extends BrowserStorageService { override get(key: string, scope: VSStorageScope, fallbackValue: string): string override get(key: string, scope: VSStorageScope): string | undefined - override get (key: string, scope: VSStorageScope, fallbackValue?: string): string | undefined { - return this.getStorage(scope)?.get(key, (this.fallbackOverride?.[key] as string | undefined) ?? fallbackValue) + override get(key: string, scope: VSStorageScope, fallbackValue?: string): string | undefined { + return this.getStorage(scope)?.get( + key, + (this.fallbackOverride?.[key] as string | undefined) ?? fallbackValue + ) } override getBoolean(key: string, scope: VSStorageScope, fallbackValue: boolean): boolean override getBoolean(key: string, scope: VSStorageScope): boolean | undefined - override getBoolean (key: string, scope: VSStorageScope, fallbackValue?: boolean): boolean | undefined { - return this.getStorage(scope)?.getBoolean(key, (this.fallbackOverride?.[key] as boolean | undefined) ?? fallbackValue) + override getBoolean( + key: string, + scope: VSStorageScope, + fallbackValue?: boolean + ): boolean | undefined { + return this.getStorage(scope)?.getBoolean( + key, + (this.fallbackOverride?.[key] as boolean | undefined) ?? fallbackValue + ) } override getNumber(key: string, scope: VSStorageScope, fallbackValue: number): number override getNumber(key: string, scope: VSStorageScope): number | undefined - override getNumber (key: string, scope: VSStorageScope, fallbackValue?: number): number | undefined { - return this.getStorage(scope)?.getNumber(key, (this.fallbackOverride?.[key] as number | undefined) ?? fallbackValue) + override getNumber( + key: string, + scope: VSStorageScope, + fallbackValue?: number + ): number | undefined { + return this.getStorage(scope)?.getNumber( + key, + (this.fallbackOverride?.[key] as number | undefined) ?? fallbackValue + ) } override getObject(key: string, scope: VSStorageScope, fallbackValue: object): object override getObject(key: string, scope: VSStorageScope): object | undefined - override getObject (key: string, scope: VSStorageScope, fallbackValue?: object): object | undefined { - return this.getStorage(scope)?.getObject(key, (this.fallbackOverride?.[key] as object | undefined) ?? fallbackValue) + override getObject( + key: string, + scope: VSStorageScope, + fallbackValue?: object + ): object | undefined { + return this.getStorage(scope)?.getObject( + key, + (this.fallbackOverride?.[key] as object | undefined) ?? fallbackValue + ) } } @@ -216,15 +296,26 @@ interface StorageServiceParameters { fallbackOverride?: Record } -export default function getStorageServiceOverride ({ customProvider, fallbackOverride }: StorageServiceParameters = {}): IEditorOverrideServices { +export default function getStorageServiceOverride({ + customProvider, + fallbackOverride +}: StorageServiceParameters = {}): IEditorOverrideServices { if (customProvider != null) { return { - [IStorageService.toString()]: new SyncDescriptor(ExternalStorageService, [customProvider, fallbackOverride], true), + [IStorageService.toString()]: new SyncDescriptor( + ExternalStorageService, + [customProvider, fallbackOverride], + true + ), [IExtensionStorageService.toString()]: new SyncDescriptor(ExtensionStorageService, [], true) } } else { return { - [IStorageService.toString()]: new SyncDescriptor(InjectedBrowserStorageService, [fallbackOverride], true), + [IStorageService.toString()]: new SyncDescriptor( + InjectedBrowserStorageService, + [fallbackOverride], + true + ), [IExtensionStorageService.toString()]: new SyncDescriptor(ExtensionStorageService, [], true) } } diff --git a/src/service-override/survey.ts b/src/service-override/survey.ts index 52c9b4e9..105b2ab6 100644 --- a/src/service-override/survey.ts +++ b/src/service-override/survey.ts @@ -2,7 +2,6 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standalone import 'vs/workbench/contrib/surveys/browser/nps.contribution' import 'vs/workbench/contrib/surveys/browser/languageSurveys.contribution' -export default function getServiceOverride (): IEditorOverrideServices { - return { - } +export default function getServiceOverride(): IEditorOverrideServices { + return {} } diff --git a/src/service-override/task.ts b/src/service-override/task.ts index 85f19bc1..14a86612 100644 --- a/src/service-override/task.ts +++ b/src/service-override/task.ts @@ -4,7 +4,7 @@ import { ITaskService } from 'vs/workbench/contrib/tasks/common/taskService.serv import { TaskService } from 'vs/workbench/contrib/tasks/browser/taskService' import 'vs/workbench/contrib/tasks/browser/task.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ITaskService.toString()]: new SyncDescriptor(TaskService, [], true) } diff --git a/src/service-override/terminal.ts b/src/service-override/terminal.ts index 9816e0f1..5f94e970 100644 --- a/src/service-override/terminal.ts +++ b/src/service-override/terminal.ts @@ -1,9 +1,28 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { ITerminalsLayoutInfo, IProcessReadyEvent, ITerminalBackend, ITerminalBackendRegistry, ITerminalChildProcess, ITerminalLaunchError, ITerminalProfile, TerminalExtensions, IPtyHostLatencyMeasurement } from 'vs/platform/terminal/common/terminal' +import { + ITerminalsLayoutInfo, + IProcessReadyEvent, + ITerminalBackend, + ITerminalBackendRegistry, + ITerminalChildProcess, + ITerminalLaunchError, + ITerminalProfile, + TerminalExtensions, + IPtyHostLatencyMeasurement +} from 'vs/platform/terminal/common/terminal' import { ITerminalLogService } from 'vs/platform/terminal/common/terminal.service' -import { ITerminalProfileResolverService, ITerminalProfileService } from 'vs/workbench/contrib/terminal/common/terminal.service' -import { ITerminalConfigurationService, ITerminalEditorService, ITerminalGroupService, ITerminalInstanceService, ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal.service' +import { + ITerminalProfileResolverService, + ITerminalProfileService +} from 'vs/workbench/contrib/terminal/common/terminal.service' +import { + ITerminalConfigurationService, + ITerminalEditorService, + ITerminalGroupService, + ITerminalInstanceService, + ITerminalService +} from 'vs/workbench/contrib/terminal/browser/terminal.service' import { TerminalService } from 'vs/workbench/contrib/terminal/browser/terminalService' import { TerminalEditorService } from 'vs/workbench/contrib/terminal/browser/terminalEditorService' import { TerminalGroupService } from 'vs/workbench/contrib/terminal/browser/terminalGroupService' @@ -32,19 +51,25 @@ import 'vs/workbench/contrib/terminal/browser/terminal.contribution' import 'vs/workbench/contrib/terminal/terminal.all' import 'vs/workbench/contrib/externalTerminal/browser/externalTerminal.contribution' import 'vs/workbench/contrib/terminal/browser/terminal.web.contribution' -export { ITerminalService, ITerminalInstanceService } from 'vs/workbench/contrib/terminal/browser/terminal.service' +export { + ITerminalService, + ITerminalInstanceService +} from 'vs/workbench/contrib/terminal/browser/terminal.service' abstract class SimpleTerminalBackend implements ITerminalBackend { getLatency = async (): Promise => [] isResponsive = true private readonly _whenConnected = new DeferredPromise() - get whenReady (): Promise { return this._whenConnected.p } - setReady (): void { + get whenReady(): Promise { + return this._whenConnected.p + } + + setReady(): void { void this._whenConnected.complete() } - async getPerformanceMarks (): Promise { + async getPerformanceMarks(): Promise { return [] } @@ -76,7 +101,7 @@ abstract class SimpleTerminalBackend implements ITerminalBackend { abstract class SimpleTerminalProcess implements ITerminalChildProcess { private onReady = new Emitter() - constructor ( + constructor( readonly id: number, readonly pid: number, readonly cwd: string, @@ -95,11 +120,11 @@ abstract class SimpleTerminalProcess implements ITerminalChildProcess { abstract start(): Promise - abstract shutdown (immediate: boolean): void + abstract shutdown(immediate: boolean): void - abstract input (data: string): void + abstract input(data: string): void - abstract resize (cols: number, rows: number): void + abstract resize(cols: number, rows: number): void shouldPersist = false onProcessData = this.onData @@ -107,33 +132,32 @@ abstract class SimpleTerminalProcess implements ITerminalChildProcess { onDidChangeProperty = Event.None onProcessExit = Event.None processBinary = unsupported - acknowledgeDataEvent (): void { - } + acknowledgeDataEvent(): void {} - async setUnicodeVersion (): Promise { - } + async setUnicodeVersion(): Promise {} - async getInitialCwd (): Promise { + async getInitialCwd(): Promise { return this.cwd } - async getCwd (): Promise { + async getCwd(): Promise { return this.cwd } - async getLatency (): Promise { + async getLatency(): Promise { return 0 } refreshProperty = async (): Promise => undefined as never - async updateProperty (): Promise { - } + async updateProperty(): Promise {} } -export default function getServiceOverride (backend?: ITerminalBackend): IEditorOverrideServices { +export default function getServiceOverride(backend?: ITerminalBackend): IEditorOverrideServices { if (backend != null) { - Registry.as(TerminalExtensions.Backend).registerTerminalBackend(backend) + Registry.as(TerminalExtensions.Backend).registerTerminalBackend( + backend + ) } return { [ITerminalService.toString()]: new SyncDescriptor(TerminalService, [], true), @@ -142,19 +166,34 @@ export default function getServiceOverride (backend?: ITerminalBackend): IEditor [ITerminalGroupService.toString()]: new SyncDescriptor(TerminalGroupService, [], true), [ITerminalInstanceService.toString()]: new SyncDescriptor(TerminalInstanceService, [], true), [ITerminalProfileService.toString()]: new SyncDescriptor(TerminalProfileService, [], true), - [ITerminalContributionService.toString()]: new SyncDescriptor(TerminalContributionService, [], true), - [ITerminalLinkProviderService.toString()]: new SyncDescriptor(TerminalLinkProviderService, [], true), - [ITerminalProfileResolverService.toString()]: new SyncDescriptor(ElectronTerminalProfileResolverService, [], true), - [IEnvironmentVariableService.toString()]: new SyncDescriptor(EnvironmentVariableService, [], true), + [ITerminalContributionService.toString()]: new SyncDescriptor( + TerminalContributionService, + [], + true + ), + [ITerminalLinkProviderService.toString()]: new SyncDescriptor( + TerminalLinkProviderService, + [], + true + ), + [ITerminalProfileResolverService.toString()]: new SyncDescriptor( + ElectronTerminalProfileResolverService, + [], + true + ), + [IEnvironmentVariableService.toString()]: new SyncDescriptor( + EnvironmentVariableService, + [], + true + ), [ITerminalQuickFixService.toString()]: new SyncDescriptor(TerminalQuickFixService, [], true), [IEmbedderTerminalService.toString()]: new SyncDescriptor(EmbedderTerminalService, [], true), - [ITerminalConfigurationService.toString()]: new SyncDescriptor(TerminalConfigurationService, [], true) + [ITerminalConfigurationService.toString()]: new SyncDescriptor( + TerminalConfigurationService, + [], + true + ) } } -export { - ITerminalBackend, - ITerminalChildProcess, - SimpleTerminalBackend, - SimpleTerminalProcess -} +export { ITerminalBackend, ITerminalChildProcess, SimpleTerminalBackend, SimpleTerminalProcess } diff --git a/src/service-override/testing.ts b/src/service-override/testing.ts index ab155c7f..1ac22003 100644 --- a/src/service-override/testing.ts +++ b/src/service-override/testing.ts @@ -22,14 +22,18 @@ import getTerminalServiceOverride from './terminal' import 'vs/workbench/contrib/testing/browser/testing.contribution' import 'vs/workbench/contrib/testing/browser/testingConfigurationUi' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { ...getTerminalServiceOverride(), [ITestService.toString()]: new SyncDescriptor(TestService, [], true), [ITestResultStorage.toString()]: new SyncDescriptor(TestResultStorage, [], true), [ITestProfileService.toString()]: new SyncDescriptor(TestProfileService, [], true), [ITestCoverageService.toString()]: new SyncDescriptor(TestCoverageService, [], true), - [ITestingContinuousRunService.toString()]: new SyncDescriptor(TestingContinuousRunService, [], true), + [ITestingContinuousRunService.toString()]: new SyncDescriptor( + TestingContinuousRunService, + [], + true + ), [ITestResultService.toString()]: new SyncDescriptor(TestResultService, [], true), [ITestExplorerFilterState.toString()]: new SyncDescriptor(TestExplorerFilterState, [], true), [ITestingPeekOpener.toString()]: new SyncDescriptor(TestingPeekOpener, [], true), diff --git a/src/service-override/textmate.ts b/src/service-override/textmate.ts index 659586c2..af8f1d4f 100644 --- a/src/service-override/textmate.ts +++ b/src/service-override/textmate.ts @@ -1,4 +1,7 @@ -import { IEditorOverrideServices, StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices' +import { + IEditorOverrideServices, + StandaloneServices +} from 'vs/editor/standalone/browser/standaloneServices' import { ITextMateTokenizationService } from 'vs/workbench/services/textMate/browser/textMateTokenizationFeature.service' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { TextMateTokenizationFeature } from 'vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl' @@ -17,19 +20,24 @@ registerAssets({ }) registerServiceInitializeParticipant(async (accessor) => { - void accessor.get(ILifecycleService).when(LifecyclePhase.Ready).then(() => { - // Force load the service - StandaloneServices.get(ITextMateTokenizationService) - }) + void accessor + .get(ILifecycleService) + .when(LifecyclePhase.Ready) + .then(() => { + // Force load the service + StandaloneServices.get(ITextMateTokenizationService) + }) }) -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { ...getFileServiceOverride(), - [ITextMateTokenizationService.toString()]: new SyncDescriptor(TextMateTokenizationFeature, [], false) + [ITextMateTokenizationService.toString()]: new SyncDescriptor( + TextMateTokenizationFeature, + [], + false + ) } } -export { - ITextMateTokenizationService -} +export { ITextMateTokenizationService } diff --git a/src/service-override/theme.ts b/src/service-override/theme.ts index 1b8971e3..2809a57a 100644 --- a/src/service-override/theme.ts +++ b/src/service-override/theme.ts @@ -9,34 +9,39 @@ import { IDisposable } from 'vs/base/common/lifecycle' import getFileServiceOverride from './files' import 'vs/workbench/contrib/themes/browser/themes.contribution' -class StandaloneWorkbenchThemeService extends WorkbenchThemeService implements Pick { - registerEditorContainer (): IDisposable { +class StandaloneWorkbenchThemeService + extends WorkbenchThemeService + implements Pick +{ + registerEditorContainer(): IDisposable { // do nothing, it's called by `StandaloneEditor` but we don't care about it return { - dispose () {} + dispose() {} } } // Let's implement setTheme as it's used by `monaco.editor.setTheme` - setTheme (themeName: string): void { - void this.getColorThemes().then(themes => { + setTheme(themeName: string): void { + void this.getColorThemes().then((themes) => { // Run in a timeout so the service is already initialized setTimeout(() => { - void this.setColorTheme(themes.find(theme => theme.settingsId === themeName) ?? themeName, ConfigurationTarget.MEMORY) + void this.setColorTheme( + themes.find((theme) => theme.settingsId === themeName) ?? themeName, + ConfigurationTarget.MEMORY + ) }) }) } } -type PartialIThemeExtensionPoint = Partial & Pick +type PartialIThemeExtensionPoint = Partial & + Pick -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { ...getFileServiceOverride(), [IThemeService.toString()]: new SyncDescriptor(StandaloneWorkbenchThemeService, [], false) } } -export { - PartialIThemeExtensionPoint as IThemeExtensionPoint -} +export { PartialIThemeExtensionPoint as IThemeExtensionPoint } diff --git a/src/service-override/timeline.ts b/src/service-override/timeline.ts index 9ac9795d..2e32ce17 100644 --- a/src/service-override/timeline.ts +++ b/src/service-override/timeline.ts @@ -5,7 +5,7 @@ import 'vs/workbench/contrib/localHistory/browser/localHistory.contribution' import { ITimelineService } from 'vs/workbench/contrib/timeline/common/timeline.service' import { TimelineService } from 'vs/workbench/contrib/timeline/common/timelineService' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ITimelineService.toString()]: new SyncDescriptor(TimelineService, [], true) } diff --git a/src/service-override/tools/editor.ts b/src/service-override/tools/editor.ts index 76ad1029..0f443a97 100644 --- a/src/service-override/tools/editor.ts +++ b/src/service-override/tools/editor.ts @@ -1,19 +1,62 @@ import { StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices' import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService' -import { isPreferredGroup, PreferredGroup, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService' +import { + isPreferredGroup, + PreferredGroup, + SIDE_GROUP +} from 'vs/workbench/services/editor/common/editorService' import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' -import { EditorCloseContext, EditorInputWithOptions, GroupModelChangeKind, IActiveEditorChangeEvent, IEditorCloseEvent, IEditorControl, IEditorPane, IEditorWillOpenEvent, IResourceDiffEditorInput, isEditorInput, isResourceEditorInput, ITextDiffEditorPane, IUntitledTextResourceEditorInput, IUntypedEditorInput, IVisibleEditorPane } from 'vs/workbench/common/editor' +import { + EditorCloseContext, + EditorInputWithOptions, + GroupModelChangeKind, + IActiveEditorChangeEvent, + IEditorCloseEvent, + IEditorControl, + IEditorPane, + IEditorWillOpenEvent, + IResourceDiffEditorInput, + isEditorInput, + isResourceEditorInput, + ITextDiffEditorPane, + IUntitledTextResourceEditorInput, + IUntypedEditorInput, + IVisibleEditorPane +} from 'vs/workbench/common/editor' import { EditorInput } from 'vs/workbench/common/editor/editorInput' -import { IEditorOptions, IResourceEditorInput, ITextResourceEditorInput } from 'vs/platform/editor/common/editor' +import { + IEditorOptions, + IResourceEditorInput, + ITextResourceEditorInput +} from 'vs/platform/editor/common/editor' import { applyTextEditorOptions } from 'vs/workbench/common/editor/editorOptions' import { ScrollType } from 'vs/editor/common/editorCommon' import { ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser' -import { IEditorGroupView, DEFAULT_EDITOR_MAX_DIMENSIONS, DEFAULT_EDITOR_MIN_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor' -import { IResolvedTextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService' -import { IStandaloneCodeEditor, StandaloneCodeEditor, StandaloneEditor } from 'vs/editor/standalone/browser/standaloneCodeEditor' +import { + IEditorGroupView, + DEFAULT_EDITOR_MAX_DIMENSIONS, + DEFAULT_EDITOR_MIN_DIMENSIONS +} from 'vs/workbench/browser/parts/editor/editor' +import { + IResolvedTextEditorModel, + ITextModelService +} from 'vs/editor/common/services/resolverService' +import { + IStandaloneCodeEditor, + StandaloneCodeEditor, + StandaloneEditor +} from 'vs/editor/standalone/browser/standaloneCodeEditor' import { Disposable, IDisposable, IReference } from 'vs/base/common/lifecycle' import { EditorService } from 'vs/workbench/services/editor/browser/editorService' -import { IAuxiliaryEditorPart, IEditorDropTargetDelegate, IEditorPart, IActiveEditorActions, IEditorGroup, IEditorWorkingSet, IEditorGroupContextKeyProvider } from 'vs/workbench/services/editor/common/editorGroupsService' +import { + IAuxiliaryEditorPart, + IEditorDropTargetDelegate, + IEditorPart, + IActiveEditorActions, + IEditorGroup, + IEditorWorkingSet, + IEditorGroupContextKeyProvider +} from 'vs/workbench/services/editor/common/editorGroupsService' import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' import { IConfigurationService } from 'vs/platform/configuration/common/configuration.service' @@ -35,7 +78,11 @@ import { mainWindow } from 'vs/base/browser/window' import { ContextKeyValue } from 'vs/platform/contextkey/common/contextkey' import { unsupported } from '../../tools' -export type OpenEditor = (modelRef: IReference, options: IEditorOptions | undefined, sideBySide?: boolean) => Promise +export type OpenEditor = ( + modelRef: IReference, + options: IEditorOptions | undefined, + sideBySide?: boolean +) => Promise class EmptyEditorGroup implements IEditorGroup, IEditorGroupView { selectedEditors = [] @@ -43,16 +90,16 @@ class EmptyEditorGroup implements IEditorGroup, IEditorGroupView { setSelection = unsupported isTransient = () => false windowId = mainWindow.vscodeWindowId - get groupsView () { + get groupsView() { return unsupported() } - notifyLabelChanged (): void {} + notifyLabelChanged(): void {} createEditorActions = unsupported onDidFocus = Event.None onDidOpenEditorFail = Event.None whenRestored = Promise.resolve() - get titleHeight () { + get titleHeight() { return unsupported() } @@ -64,7 +111,7 @@ class EmptyEditorGroup implements IEditorGroup, IEditorGroupView { toJSON = unsupported preferredWidth?: number | undefined preferredHeight?: number | undefined - get element () { + get element() { return unsupported() } @@ -93,7 +140,10 @@ class EmptyEditorGroup implements IEditorGroup, IEditorGroupView { isLocked = false stickyCount = 0 editors = [] - get scopedContextKeyService (): IContextKeyService { return StandaloneServices.get(IContextKeyService) } + get scopedContextKeyService(): IContextKeyService { + return StandaloneServices.get(IContextKeyService) + } + getEditors = () => [] findEditors = () => [] getEditorByIndex = () => undefined @@ -116,7 +166,7 @@ class EmptyEditorGroup implements IEditorGroup, IEditorGroupView { stickEditor = () => {} unstickEditor = () => {} lock = () => {} - focus (): void { + focus(): void { // ignore } @@ -127,7 +177,7 @@ class EmptyEditorGroup implements IEditorGroup, IEditorGroupView { export const fakeActiveGroup = new EmptyEditorGroup() class SimpleEditorPane implements IEditorPane { - constructor (private editor?: ICodeEditor) {} + constructor(private editor?: ICodeEditor) {} onDidChangeControl = Event.None onDidChangeSizeConstraints = Event.None @@ -137,10 +187,22 @@ class SimpleEditorPane implements IEditorPane { options = undefined group = fakeActiveGroup scopedContextKeyService = undefined - get minimumWidth () { return DEFAULT_EDITOR_MIN_DIMENSIONS.width } - get maximumWidth () { return DEFAULT_EDITOR_MAX_DIMENSIONS.width } - get minimumHeight () { return DEFAULT_EDITOR_MIN_DIMENSIONS.height } - get maximumHeight () { return DEFAULT_EDITOR_MAX_DIMENSIONS.height } + get minimumWidth() { + return DEFAULT_EDITOR_MIN_DIMENSIONS.width + } + + get maximumWidth() { + return DEFAULT_EDITOR_MAX_DIMENSIONS.width + } + + get minimumHeight() { + return DEFAULT_EDITOR_MIN_DIMENSIONS.height + } + + get maximumHeight() { + return DEFAULT_EDITOR_MAX_DIMENSIONS.height + } + getViewState = unsupported isVisible = unsupported hasFocus = unsupported @@ -148,26 +210,57 @@ class SimpleEditorPane implements IEditorPane { getTitle = unsupported focus = unsupported - getControl (): IEditorControl | undefined { + getControl(): IEditorControl | undefined { return this.editor } } -export function wrapOpenEditor (textModelService: ITextModelService, defaultBehavior: IEditorService['openEditor'], fallbackBahavior?: OpenEditor): IEditorService['openEditor'] { - function openEditor(editor: EditorInput, options?: IEditorOptions, group?: PreferredGroup): Promise - function openEditor(editor: IUntypedEditorInput, group?: PreferredGroup): Promise - function openEditor(editor: IResourceEditorInput, group?: PreferredGroup): Promise - function openEditor(editor: ITextResourceEditorInput | IUntitledTextResourceEditorInput, group?: PreferredGroup): Promise - function openEditor(editor: IResourceDiffEditorInput, group?: PreferredGroup): Promise - function openEditor(editor: EditorInput | IUntypedEditorInput, optionsOrPreferredGroup?: IEditorOptions | PreferredGroup, preferredGroup?: PreferredGroup): Promise - async function openEditor (editor: EditorInput | IUntypedEditorInput, optionsOrPreferredGroup?: IEditorOptions | PreferredGroup, preferredGroup?: PreferredGroup): Promise { - const options = isEditorInput(editor) ? optionsOrPreferredGroup as IEditorOptions : editor.options +export function wrapOpenEditor( + textModelService: ITextModelService, + defaultBehavior: IEditorService['openEditor'], + fallbackBahavior?: OpenEditor +): IEditorService['openEditor'] { + function openEditor( + editor: EditorInput, + options?: IEditorOptions, + group?: PreferredGroup + ): Promise + function openEditor( + editor: IUntypedEditorInput, + group?: PreferredGroup + ): Promise + function openEditor( + editor: IResourceEditorInput, + group?: PreferredGroup + ): Promise + function openEditor( + editor: ITextResourceEditorInput | IUntitledTextResourceEditorInput, + group?: PreferredGroup + ): Promise + function openEditor( + editor: IResourceDiffEditorInput, + group?: PreferredGroup + ): Promise + function openEditor( + editor: EditorInput | IUntypedEditorInput, + optionsOrPreferredGroup?: IEditorOptions | PreferredGroup, + preferredGroup?: PreferredGroup + ): Promise + async function openEditor( + editor: EditorInput | IUntypedEditorInput, + optionsOrPreferredGroup?: IEditorOptions | PreferredGroup, + preferredGroup?: PreferredGroup + ): Promise { + const options = isEditorInput(editor) + ? (optionsOrPreferredGroup as IEditorOptions) + : editor.options if (isPreferredGroup(optionsOrPreferredGroup)) { preferredGroup = optionsOrPreferredGroup } - const resource = isResourceEditorInput(editor) || isEditorInput(editor) ? editor.resource : undefined + const resource = + isResourceEditorInput(editor) || isEditorInput(editor) ? editor.resource : undefined if (resource == null || !textModelService.canHandleResource(resource)) { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -178,11 +271,21 @@ export function wrapOpenEditor (textModelService: ITextModelService, defaultBeha // If the model is already existing, try to find an associated editor const codeEditors = StandaloneServices.get(ICodeEditorService).listCodeEditors() - modelEditor = codeEditors.find(editor => editor instanceof StandaloneEditor && editor.getModel() != null && editor.getModel()!.uri.toString() === resource.toString()) + modelEditor = codeEditors.find( + (editor) => + editor instanceof StandaloneEditor && + editor.getModel() != null && + editor.getModel()!.uri.toString() === resource.toString() + ) if (modelEditor == null) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const defaultBehaviorResult = await defaultBehavior(editor as any, optionsOrPreferredGroup as any, preferredGroup) + const defaultBehaviorResult = await defaultBehavior( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + editor as any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + optionsOrPreferredGroup as any, + preferredGroup + ) if (defaultBehaviorResult != null) { return defaultBehaviorResult } @@ -216,7 +319,7 @@ export function wrapOpenEditor (textModelService: ITextModelService, defaultBeha } export class MonacoEditorService extends EditorService { - constructor ( + constructor( _openEditorFallback: OpenEditor | undefined, private _isEditorPartVisible: () => boolean, @IEditorGroupsService _editorGroupService: IEditorGroupsService, @@ -245,10 +348,14 @@ export class MonacoEditorService extends EditorService { textEditorService ) - this.openEditor = wrapOpenEditor(textModelService, this.openEditor.bind(this), _openEditorFallback) + this.openEditor = wrapOpenEditor( + textModelService, + this.openEditor.bind(this), + _openEditorFallback + ) } - override get activeTextEditorControl (): ICodeEditor | IDiffEditor | undefined { + override get activeTextEditorControl(): ICodeEditor | IDiffEditor | undefined { // By default, only the editor inside the EditorPart can be "active" here, hack it so the active editor is now the focused editor if it exists // It is required for the editor.addAction to be able to add an entry in the editor action menu const focusedCodeEditor = StandaloneServices.get(ICodeEditorService).getFocusedCodeEditor() @@ -260,13 +367,43 @@ export class MonacoEditorService extends EditorService { } // Override openEditor to fallback on user function is the EditorPart is not visible - override openEditor(editor: EditorInput, options?: IEditorOptions, group?: PreferredGroup): Promise - override openEditor(editor: IUntypedEditorInput, group?: PreferredGroup): Promise - override openEditor(editor: IResourceEditorInput, group?: PreferredGroup): Promise - override openEditor(editor: ITextResourceEditorInput | IUntitledTextResourceEditorInput, group?: PreferredGroup): Promise - override openEditor(editor: IResourceDiffEditorInput, group?: PreferredGroup): Promise - override openEditor(editor: EditorInput | IUntypedEditorInput, optionsOrPreferredGroup?: IEditorOptions | PreferredGroup, preferredGroup?: PreferredGroup): Promise - override async openEditor (editor: EditorInput | IUntypedEditorInput, optionsOrPreferredGroup?: IEditorOptions | PreferredGroup, preferredGroup?: PreferredGroup): Promise { + override openEditor( + editor: EditorInput, + options?: IEditorOptions, + group?: PreferredGroup + ): Promise + + override openEditor( + editor: IUntypedEditorInput, + group?: PreferredGroup + ): Promise + + override openEditor( + editor: IResourceEditorInput, + group?: PreferredGroup + ): Promise + + override openEditor( + editor: ITextResourceEditorInput | IUntitledTextResourceEditorInput, + group?: PreferredGroup + ): Promise + + override openEditor( + editor: IResourceDiffEditorInput, + group?: PreferredGroup + ): Promise + + override openEditor( + editor: EditorInput | IUntypedEditorInput, + optionsOrPreferredGroup?: IEditorOptions | PreferredGroup, + preferredGroup?: PreferredGroup + ): Promise + + override async openEditor( + editor: EditorInput | IUntypedEditorInput, + optionsOrPreferredGroup?: IEditorOptions | PreferredGroup, + preferredGroup?: PreferredGroup + ): Promise { // Do not try to open the file if the editor part is not displayed, let the fallback happen if (!this._isEditorPartVisible()) { return undefined @@ -277,8 +414,11 @@ export class MonacoEditorService extends EditorService { } class StandaloneEditorPane implements IVisibleEditorPane { - constructor (public readonly editor: IStandaloneCodeEditor, public input: TextResourceEditorInput, public group: IEditorGroup) { - } + constructor( + public readonly editor: IStandaloneCodeEditor, + public input: TextResourceEditorInput, + public group: IEditorGroup + ) {} onDidChangeControl = Event.None @@ -289,33 +429,33 @@ class StandaloneEditorPane implements IVisibleEditorPane { maximumHeight = Number.POSITIVE_INFINITY onDidChangeSizeConstraints = Event.None scopedContextKeyService = undefined - getControl (): IEditorControl | undefined { + getControl(): IEditorControl | undefined { return this.editor } - getViewState (): object | undefined { + getViewState(): object | undefined { return undefined } - isVisible (): boolean { + isVisible(): boolean { return true } onDidFocus = this.editor.onDidFocusEditorWidget onDidBlur = this.editor.onDidBlurEditorWidget - hasFocus (): boolean { + hasFocus(): boolean { return this.editor.hasWidgetFocus() } - getId (): string { + getId(): string { return this.editor.getId() } - getTitle (): string | undefined { + getTitle(): string | undefined { return undefined } - focus (): void { + focus(): void { this.editor.focus() } } @@ -325,14 +465,21 @@ class StandaloneEditorGroup extends Disposable implements IEditorGroup, IEditorG private pane: StandaloneEditorPane | undefined public active: boolean = false - constructor ( + constructor( public editor: IStandaloneCodeEditor, @IInstantiationService instantiationService: IInstantiationService, @IContextKeyService public scopedContextKeyService: IContextKeyService ) { super() const onNewModel = (uri: URI) => { - const editorInput = instantiationService.createInstance(TextResourceEditorInput, uri, undefined, undefined, undefined, undefined) + const editorInput = instantiationService.createInstance( + TextResourceEditorInput, + uri, + undefined, + undefined, + undefined, + undefined + ) this._onWillOpenEditor.fire({ editor: editorInput, @@ -392,7 +539,14 @@ class StandaloneEditorGroup extends Disposable implements IEditorGroup, IEditorG }) const currentModel = editor.getModel() if (currentModel != null) { - const editorInput = instantiationService.createInstance(TextResourceEditorInput, currentModel.uri, undefined, undefined, undefined, undefined) + const editorInput = instantiationService.createInstance( + TextResourceEditorInput, + currentModel.uri, + undefined, + undefined, + undefined, + undefined + ) this.pane = new StandaloneEditorPane(editor, editorInput, this) } } @@ -405,13 +559,13 @@ class StandaloneEditorGroup extends Disposable implements IEditorGroup, IEditorG windowId = mainWindow.vscodeWindowId - get groupsView () { + get groupsView() { return unsupported() } - notifyLabelChanged (): void {} + notifyLabelChanged(): void {} - createEditorActions (): IActiveEditorActions { + createEditorActions(): IActiveEditorActions { return { actions: { primary: [], @@ -424,16 +578,19 @@ class StandaloneEditorGroup extends Disposable implements IEditorGroup, IEditorG onDidFocus = this.editor.onDidFocusEditorWidget onDidOpenEditorFail = Event.None whenRestored = Promise.resolve() - get titleHeight () { return unsupported() } + get titleHeight() { + return unsupported() + } + disposed = false - setActive (isActive: boolean) { + setActive(isActive: boolean) { this.active = isActive } notifyIndexChanged = unsupported relayout = unsupported toJSON = unsupported - get element () { + get element() { return this.editor.getContainerDomNode() } @@ -465,39 +622,50 @@ class StandaloneEditorGroup extends Disposable implements IEditorGroup, IEditorG index = -1 label = `standalone editor ${-this.id}` ariaLabel = `standalone editor ${-this.id}` - get activeEditorPane () { + get activeEditorPane() { return this.pane } - get activeEditor () { + get activeEditor() { return this.pane?.input ?? null } previewEditor = null - get count () { + get count() { return this.pane != null ? 1 : 0 } - get isEmpty () { + get isEmpty() { return this.pane == null } isLocked = true stickyCount = 0 - get editors () { + get editors() { return this.pane != null ? [this.pane.input] : [] } getEditors = () => this.editors - findEditors = (resource: URI) => this.pane != null && resource.toString() === this.pane.input.resource.toString() ? [this.pane.input] : [] - getEditorByIndex = (index: number) => this.pane != null && index === 0 ? this.pane.input : undefined - getIndexOfEditor = (editorInput: EditorInput) => this.pane != null && this.pane.input === editorInput ? 0 : -1 + findEditors = (resource: URI) => + this.pane != null && resource.toString() === this.pane.input.resource.toString() + ? [this.pane.input] + : [] + + getEditorByIndex = (index: number) => + this.pane != null && index === 0 ? this.pane.input : undefined + + getIndexOfEditor = (editorInput: EditorInput) => + this.pane != null && this.pane.input === editorInput ? 0 : -1 + openEditor = async (editor: EditorInput): Promise => { if (editor.isDisposed()) { return undefined } - if (editor instanceof TextResourceEditorInput && editor.resource.toString() === this.pane?.input.resource.toString()) { + if ( + editor instanceof TextResourceEditorInput && + editor.resource.toString() === this.pane?.input.resource.toString() + ) { this.focus() return this.pane } @@ -530,7 +698,7 @@ class StandaloneEditorGroup extends Disposable implements IEditorGroup, IEditorG stickEditor = () => {} unstickEditor = () => {} lock = () => {} - focus (): void { + focus(): void { this.editor.focus() this.editor.getContainerDomNode().scrollIntoView() } @@ -539,13 +707,20 @@ class StandaloneEditorGroup extends Disposable implements IEditorGroup, IEditorG isLast = unsupported } -export class MonacoDelegateEditorGroupsService extends Disposable implements IEditorGroupsService { +export class MonacoDelegateEditorGroupsService + extends Disposable + implements IEditorGroupsService +{ readonly _serviceBrand = undefined public additionalGroups: StandaloneEditorGroup[] = [] public activeGroupOverride: StandaloneEditorGroup | undefined = undefined - constructor (protected delegate: D, emptyDelegate: boolean, @IInstantiationService private instantiationService: IInstantiationService) { + constructor( + protected delegate: D, + emptyDelegate: boolean, + @IInstantiationService private instantiationService: IInstantiationService + ) { super() setTimeout(() => { const codeEditorService = StandaloneServices.get(ICodeEditorService) @@ -554,14 +729,21 @@ export class MonacoDelegateEditorGroupsService e if (editor instanceof StandaloneEditor) { let timeout: number | undefined const updateActiveGroup = (editor: StandaloneEditor | undefined) => { - const newActiveGroup = editor != null ? this.additionalGroups.find(group => group.editor === editor) : undefined + const newActiveGroup = + editor != null + ? this.additionalGroups.find((group) => group.editor === editor) + : undefined if (this.activeGroupOverride !== newActiveGroup) { this.activeGroupOverride = newActiveGroup this._onDidChangeActiveGroup.fire(this.activeGroup) } } const removeActiveGroup = (editor: StandaloneEditor | undefined) => { - if (!emptyDelegate && this.activeGroupOverride === this.additionalGroups.find(group => group.editor === editor)) { + if ( + !emptyDelegate && + this.activeGroupOverride === + this.additionalGroups.find((group) => group.editor === editor) + ) { updateActiveGroup(undefined) } } @@ -597,14 +779,14 @@ export class MonacoDelegateEditorGroupsService e } const handleCodeEditorRemoved = (editor: ICodeEditor) => { if (editor instanceof StandaloneEditor) { - const removedGroup = this.additionalGroups.find(group => group.editor === editor) + const removedGroup = this.additionalGroups.find((group) => group.editor === editor) if (removedGroup != null) { removedGroup.dispose() if (this.activeGroupOverride === removedGroup) { this.activeGroupOverride = undefined this._onDidChangeActiveGroup.fire(this.activeGroup) } - this.additionalGroups = this.additionalGroups.filter(group => group !== removedGroup) + this.additionalGroups = this.additionalGroups.filter((group) => group !== removedGroup) this._onDidRemoveGroup.fire(removedGroup) } } @@ -615,82 +797,95 @@ export class MonacoDelegateEditorGroupsService e }) } - getScopedInstantiationService (): IInstantiationService { + getScopedInstantiationService(): IInstantiationService { return this.instantiationService } - registerContextKeyProvider (provider: IEditorGroupContextKeyProvider): IDisposable { + registerContextKeyProvider( + provider: IEditorGroupContextKeyProvider + ): IDisposable { return this.delegate.registerContextKeyProvider(provider) } - saveWorkingSet (name: string): IEditorWorkingSet { + saveWorkingSet(name: string): IEditorWorkingSet { return this.delegate.saveWorkingSet(name) } - getWorkingSets (): IEditorWorkingSet[] { + getWorkingSets(): IEditorWorkingSet[] { return this.delegate.getWorkingSets() } - applyWorkingSet (workingSet: IEditorWorkingSet | 'empty'): Promise { + applyWorkingSet(workingSet: IEditorWorkingSet | 'empty'): Promise { return this.delegate.applyWorkingSet(workingSet) } - deleteWorkingSet (workingSet: IEditorWorkingSet): void { + deleteWorkingSet(workingSet: IEditorWorkingSet): void { return this.delegate.deleteWorkingSet(workingSet) } - get isReady (): IEditorGroupsService['isReady'] { + get isReady(): IEditorGroupsService['isReady'] { return this.delegate.isReady } - get whenReady (): IEditorGroupsService['whenReady'] { + get whenReady(): IEditorGroupsService['whenReady'] { return this.delegate.whenReady } - get whenRestored (): IEditorGroupsService['whenRestored'] { + get whenRestored(): IEditorGroupsService['whenRestored'] { return this.delegate.whenRestored } - get hasRestorableState (): IEditorGroupsService['hasRestorableState'] { + get hasRestorableState(): IEditorGroupsService['hasRestorableState'] { return this.delegate.hasRestorableState } onDidCreateAuxiliaryEditorPart = this.delegate.onDidCreateAuxiliaryEditorPart - get parts (): IEditorGroupsService['parts'] { return this.delegate.parts } - createAuxiliaryEditorPart (options?: { bounds?: Partial | undefined } | undefined): Promise { + get parts(): IEditorGroupsService['parts'] { + return this.delegate.parts + } + + createAuxiliaryEditorPart( + options?: { bounds?: Partial | undefined } | undefined + ): Promise { return this.delegate.createAuxiliaryEditorPart(options) } - get mainPart (): IEditorGroupsService['mainPart'] { return this.delegate.mainPart } + get mainPart(): IEditorGroupsService['mainPart'] { + return this.delegate.mainPart + } + onDidChangeGroupMaximized = this.delegate.onDidChangeGroupMaximized getPart(group: number | IEditorGroup): IEditorPart getPart(container: unknown): IEditorPart | undefined - getPart (container: unknown): IEditorPart | undefined { + getPart(container: unknown): IEditorPart | undefined { return this.delegate.getPart(container) } - toggleMaximizeGroup (group?: number | IEditorGroup | undefined): void { + toggleMaximizeGroup(group?: number | IEditorGroup | undefined): void { return this.delegate.toggleMaximizeGroup(group) } - toggleExpandGroup (group?: number | IEditorGroup | undefined): void { + toggleExpandGroup(group?: number | IEditorGroup | undefined): void { return this.delegate.toggleExpandGroup(group) } - createEditorDropTarget (container: unknown, delegate: IEditorDropTargetDelegate): IDisposable { + createEditorDropTarget(container: unknown, delegate: IEditorDropTargetDelegate): IDisposable { return this.delegate.createEditorDropTarget(container, delegate) } - public get groups (): IEditorGroup[] { + public get groups(): IEditorGroup[] { return [...this.additionalGroups, ...this.delegate.groups] } - public get activeGroup (): IEditorGroup { + public get activeGroup(): IEditorGroup { return this.activeGroupOverride ?? this.delegate.activeGroup } _onDidChangeActiveGroup = new Emitter() - onDidChangeActiveGroup = Event.any(this._onDidChangeActiveGroup.event, this.delegate.onDidChangeActiveGroup) + onDidChangeActiveGroup = Event.any( + this._onDidChangeActiveGroup.event, + this.delegate.onDidChangeActiveGroup + ) _onDidAddGroup = new Emitter() onDidAddGroup = Event.any(this._onDidAddGroup.event, this.delegate.onDidAddGroup) @@ -702,10 +897,21 @@ export class MonacoDelegateEditorGroupsService e onDidActivateGroup = this.delegate.onDidActivateGroup onDidChangeGroupIndex = this.delegate.onDidChangeGroupIndex onDidChangeGroupLocked = this.delegate.onDidChangeGroupLocked - get sideGroup (): IEditorGroupsService['sideGroup'] { return this.delegate.sideGroup } - get count (): IEditorGroupsService['count'] { return this.delegate.count + this.additionalGroups.length } - get orientation (): IEditorGroupsService['orientation'] { return this.delegate.orientation } - get partOptions (): IEditorGroupsService['partOptions'] { return this.delegate.partOptions } + get sideGroup(): IEditorGroupsService['sideGroup'] { + return this.delegate.sideGroup + } + + get count(): IEditorGroupsService['count'] { + return this.delegate.count + this.additionalGroups.length + } + + get orientation(): IEditorGroupsService['orientation'] { + return this.delegate.orientation + } + + get partOptions(): IEditorGroupsService['partOptions'] { + return this.delegate.partOptions + } getLayout: IEditorGroupsService['getLayout'] = () => { return this.delegate.getLayout() @@ -716,7 +922,10 @@ export class MonacoDelegateEditorGroupsService e } getGroup: IEditorGroupsService['getGroup'] = (identifier) => { - return this.delegate.getGroup(identifier) ?? this.additionalGroups.find(group => group.id === identifier) + return ( + this.delegate.getGroup(identifier) ?? + this.additionalGroups.find((group) => group.id === identifier) + ) } activateGroup: IEditorGroupsService['activateGroup'] = (...args) => { diff --git a/src/service-override/tools/url.ts b/src/service-override/tools/url.ts index 4f1817cf..ab722b83 100644 --- a/src/service-override/tools/url.ts +++ b/src/service-override/tools/url.ts @@ -1,4 +1,4 @@ -export function changeUrlDomain (url: string, domain?: string): string { +export function changeUrlDomain(url: string, domain?: string): string { if (domain == null) { return url } diff --git a/src/service-override/tools/views.ts b/src/service-override/tools/views.ts index cfeace63..cf90c74c 100644 --- a/src/service-override/tools/views.ts +++ b/src/service-override/tools/views.ts @@ -1,5 +1,13 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IViewContainerDescriptor, IViewContainersRegistry, IViewDescriptor, IViewsRegistry, ViewContainer, ViewContainerLocation, Extensions as ViewExtensions } from 'vs/workbench/common/views' +import { + IViewContainerDescriptor, + IViewContainersRegistry, + IViewDescriptor, + IViewsRegistry, + ViewContainer, + ViewContainerLocation, + Extensions as ViewExtensions +} from 'vs/workbench/common/views' import { BrandedService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' import { DisposableStore, IDisposable, MutableDisposable } from 'vs/base/common/lifecycle' import { $, Dimension, size } from 'vs/base/browser/dom' @@ -8,10 +16,22 @@ import { Registry } from 'vs/platform/registry/common/platform' import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer' import { URI } from 'vs/base/common/uri' import { Codicon } from 'vs/base/common/codicons' -import { EditorInputFactoryObject, RegisteredEditorInfo, RegisteredEditorOptions, RegisteredEditorPriority } from 'vs/workbench/services/editor/common/editorResolverService' +import { + EditorInputFactoryObject, + RegisteredEditorInfo, + RegisteredEditorOptions, + RegisteredEditorPriority +} from 'vs/workbench/services/editor/common/editorResolverService' import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService.service' import { EditorInput, IEditorCloseHandler } from 'vs/workbench/common/editor/editorInput' -import { EditorExtensions, EditorInputCapabilities, IEditorFactoryRegistry, IEditorOpenContext, IEditorSerializer, Verbosity } from 'vs/workbench/common/editor' +import { + EditorExtensions, + EditorInputCapabilities, + IEditorFactoryRegistry, + IEditorOpenContext, + IEditorSerializer, + Verbosity +} from 'vs/workbench/common/editor' import { IEditorOptions, IResourceEditorInput } from 'vs/platform/editor/common/editor' import { Action2, MenuId, registerAction2 } from 'vs/platform/actions/common/actions' import { Categories } from 'vs/platform/action/common/actionCommonCategories' @@ -39,18 +59,23 @@ import { IView, SplitView } from 'vs/base/browser/ui/splitview/splitview' import type { LayoutService } from '../layout' import { IEditorGroup, withReadyServices } from '../../services' -type Label = string | { - short: string - medium: string - long: string -} +type Label = + | string + | { + short: string + medium: string + long: string + } abstract class InjectedEditorPane extends EditorPane { - constructor ( - id: string, - group: IEditorGroup - ) { - super(id, group, StandaloneServices.get(ITelemetryService), StandaloneServices.get(IThemeService), StandaloneServices.get(IStorageService)) + constructor(id: string, group: IEditorGroup) { + super( + id, + group, + StandaloneServices.get(ITelemetryService), + StandaloneServices.get(IThemeService), + StandaloneServices.get(IStorageService) + ) } } @@ -60,14 +85,19 @@ abstract class SimpleEditorPane extends InjectedEditorPane { protected scrollbar: DomScrollableElement | undefined private inputDisposable = this._register(new MutableDisposable()) - protected override createEditor (parent: HTMLElement): void { + protected override createEditor(parent: HTMLElement): void { this.container = this.initialize() this.wrapper = document.createElement('div') this.wrapper.append(this.container) // Custom Scrollbars - this.scrollbar = this._register(new DomScrollableElement(this.wrapper, { horizontal: ScrollbarVisibility.Auto, vertical: ScrollbarVisibility.Auto })) + this.scrollbar = this._register( + new DomScrollableElement(this.wrapper, { + horizontal: ScrollbarVisibility.Auto, + vertical: ScrollbarVisibility.Auto + }) + ) parent.appendChild(this.scrollbar.getDomNode()) const observer = new ResizeObserver(() => { @@ -75,13 +105,18 @@ abstract class SimpleEditorPane extends InjectedEditorPane { }) observer.observe(this.container) this._register({ - dispose () { + dispose() { observer.disconnect() } }) } - override async setInput (input: EditorInput, editorOptions: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise { + override async setInput( + input: EditorInput, + editorOptions: IEditorOptions | undefined, + context: IEditorOpenContext, + token: CancellationToken + ): Promise { await super.setInput(input, editorOptions, context, token) // Check for cancellation @@ -93,7 +128,7 @@ abstract class SimpleEditorPane extends InjectedEditorPane { assertIsDefined(this.scrollbar).scanDomNode() } - override layout (dimension: Dimension): void { + override layout(dimension: Dimension): void { const [wrapper, scrollbar] = assertAllDefined(this.wrapper, this.scrollbar) // Pass on to Container @@ -103,20 +138,25 @@ abstract class SimpleEditorPane extends InjectedEditorPane { scrollbar.scanDomNode() } - override focus (): void { + override focus(): void { const container = assertIsDefined(this.container) container.focus() } - override clearInput (): void { + override clearInput(): void { this.inputDisposable.clear() super.clearInput() } - abstract initialize (): HTMLElement - abstract renderInput? (input: EditorInput, options: IEditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise + abstract initialize(): HTMLElement + abstract renderInput?( + input: EditorInput, + options: IEditorOptions | undefined, + context: IEditorOpenContext, + token: CancellationToken + ): Promise } abstract class SimpleEditorInput extends EditorInput { @@ -127,45 +167,48 @@ abstract class SimpleEditorInput extends EditorInput { private description: Label | undefined public override resource: URI | undefined - constructor (resource?: URI, public override closeHandler?: IEditorCloseHandler) { + constructor( + resource?: URI, + public override closeHandler?: IEditorCloseHandler + ) { super() this.resource = resource } - public override get capabilities (): EditorInputCapabilities { + public override get capabilities(): EditorInputCapabilities { return this._capabilities } - public addCapability (capability: EditorInputCapabilities): void { + public addCapability(capability: EditorInputCapabilities): void { this._capabilities |= capability this._onDidChangeCapabilities.fire() } - public removeCapability (capability: EditorInputCapabilities): void { + public removeCapability(capability: EditorInputCapabilities): void { this._capabilities &= ~capability this._onDidChangeCapabilities.fire() } - override get editorId (): string | undefined { + override get editorId(): string | undefined { return this.typeId } - public setName (name: string): void { + public setName(name: string): void { this.name = name this._onDidChangeLabel.fire() } - public setTitle (title: Label): void { + public setTitle(title: Label): void { this.title = title this._onDidChangeLabel.fire() } - public setDescription (description: string): void { + public setDescription(description: string): void { this.description = description this._onDidChangeLabel.fire() } - private getLabelValue (label: Label, verbosity?: Verbosity) { + private getLabelValue(label: Label, verbosity?: Verbosity) { if (typeof label === 'string') { return label } @@ -180,28 +223,28 @@ abstract class SimpleEditorInput extends EditorInput { } } - override getName (): string { + override getName(): string { return this.name ?? 'Unnamed' } - override getTitle (verbosity?: Verbosity): string { + override getTitle(verbosity?: Verbosity): string { return this.getLabelValue(this.title ?? this.getName(), verbosity) } - override getDescription (verbosity?: Verbosity): string { + override getDescription(verbosity?: Verbosity): string { return this.getLabelValue(this.description ?? this.getName(), verbosity) } - override isDirty (): boolean { + override isDirty(): boolean { return this.dirty } - public setDirty (dirty: boolean): void { + public setDirty(dirty: boolean): void { this.dirty = dirty this._onDidChangeDirty.fire() } - public override toUntyped (): IResourceEditorInput | undefined { + public override toUntyped(): IResourceEditorInput | undefined { if (this.resource == null) { return undefined } @@ -211,44 +254,46 @@ abstract class SimpleEditorInput extends EditorInput { } } -function registerEditorPane ( +function registerEditorPane( typeId: string, name: string, ctor: new (group: IEditorGroup, ...services: Services) => EditorPane, inputCtors: (new (...args: any[]) => EditorInput)[] ): IDisposable { return Registry.as(EditorExtensions.EditorPane).registerEditorPane( - EditorPaneDescriptor.create( - ctor, - typeId, - name - ), - inputCtors.map(ctor => new SyncDescriptor(ctor))) + EditorPaneDescriptor.create(ctor, typeId, name), + inputCtors.map((ctor) => new SyncDescriptor(ctor)) + ) } -function registerEditor (globPattern: string, editorInfo: RegisteredEditorInfo, editorOptions: RegisteredEditorOptions, factory: EditorInputFactoryObject): IDisposable { +function registerEditor( + globPattern: string, + editorInfo: RegisteredEditorInfo, + editorOptions: RegisteredEditorOptions, + factory: EditorInputFactoryObject +): IDisposable { return withReadyServices((servicesAccessor) => { const resolverService = servicesAccessor.get(IEditorResolverService) - return resolverService.registerEditor( - globPattern, - editorInfo, - editorOptions, - factory - ) + return resolverService.registerEditor(globPattern, editorInfo, editorOptions, factory) }) } -function registerEditorSerializer (editorTypeId: string, ctor: { - new (...Services: Services): IEditorSerializer -}): IDisposable { - return Registry.as(EditorExtensions.EditorFactory).registerEditorSerializer(editorTypeId, ctor) +function registerEditorSerializer( + editorTypeId: string, + ctor: { + new (...Services: Services): IEditorSerializer + } +): IDisposable { + return Registry.as( + EditorExtensions.EditorFactory + ).registerEditorSerializer(editorTypeId, ctor) } interface CustomViewOption { readonly id: string name: string order?: number - renderBody (container: HTMLElement, scrollbar: DomScrollableElement): IDisposable + renderBody(container: HTMLElement, scrollbar: DomScrollableElement): IDisposable location: ViewContainerLocation icon?: string canMoveView?: boolean @@ -258,7 +303,7 @@ interface CustomViewOption { title: string tooltip?: string order?: number - run? (accessor: ServicesAccessor): Promise + run?(accessor: ServicesAccessor): Promise icon?: keyof typeof Codicon render?(container: HTMLElement): void }[] @@ -268,96 +313,124 @@ interface CustomViewOption { collapsed?: boolean } -const viewContainerRegistry = Registry.as(ViewExtensions.ViewContainersRegistry) +const viewContainerRegistry = Registry.as( + ViewExtensions.ViewContainersRegistry +) const viewRegistry = Registry.as(ViewExtensions.ViewsRegistry) -function registerCustomView (options: CustomViewOption): IDisposable { +function registerCustomView(options: CustomViewOption): IDisposable { const iconUrl = options.icon != null ? URI.parse(options.icon) : undefined - const viewContainer = options.viewContainer ?? viewContainerRegistry.registerViewContainer({ - id: options.id, - title: { value: options.name, original: options.name }, - order: options.order, - ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [options.id, { mergeViewWithContainerWhenSingleView: true }]), - hideIfEmpty: true, - icon: iconUrl - }, options.location, { - isDefault: options.default - }) + const viewContainer = + options.viewContainer ?? + viewContainerRegistry.registerViewContainer( + { + id: options.id, + title: { value: options.name, original: options.name }, + order: options.order, + ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [ + options.id, + { mergeViewWithContainerWhenSingleView: true } + ]), + hideIfEmpty: true, + icon: iconUrl + }, + options.location, + { + isDefault: options.default + } + ) - const views: IViewDescriptor[] = [{ - id: options.id, - name: { - value: options.name, - original: options.name - }, - ctorDescriptor: new SyncDescriptor(class extends ViewPane { - protected wrapper!: HTMLElement - protected container!: HTMLElement - protected scrollbar: DomScrollableElement | undefined - - protected override renderBody (container: HTMLElement): void { - super.renderBody(container) - - this.wrapper = document.createElement('div') - - this.scrollbar = this._register(new DomScrollableElement(this.wrapper, { horizontal: ScrollbarVisibility.Auto, vertical: ScrollbarVisibility.Auto })) - - this.container = $('.view-pane-content') - this.container.style.display = 'flex' - this.container.style.alignItems = 'stretch' - this._register(options.renderBody(this.container, this.scrollbar)) - - this.wrapper.append(this.container) - - // Custom Scrollbars - container.appendChild(this.scrollbar.getDomNode()) - - const observer = new ResizeObserver(() => { - assertIsDefined(this.scrollbar).scanDomNode() - }) - observer.observe(this.container) - this._register({ - dispose () { - observer.disconnect() + const views: IViewDescriptor[] = [ + { + id: options.id, + name: { + value: options.name, + original: options.name + }, + ctorDescriptor: new SyncDescriptor( + class extends ViewPane { + protected wrapper!: HTMLElement + protected container!: HTMLElement + protected scrollbar: DomScrollableElement | undefined + + protected override renderBody(container: HTMLElement): void { + super.renderBody(container) + + this.wrapper = document.createElement('div') + + this.scrollbar = this._register( + new DomScrollableElement(this.wrapper, { + horizontal: ScrollbarVisibility.Auto, + vertical: ScrollbarVisibility.Auto + }) + ) + + this.container = $('.view-pane-content') + this.container.style.display = 'flex' + this.container.style.alignItems = 'stretch' + this._register(options.renderBody(this.container, this.scrollbar)) + + this.wrapper.append(this.container) + + // Custom Scrollbars + container.appendChild(this.scrollbar.getDomNode()) + + const observer = new ResizeObserver(() => { + assertIsDefined(this.scrollbar).scanDomNode() + }) + observer.observe(this.container) + this._register({ + dispose() { + observer.disconnect() + } + }) } - }) - } - public override getActionViewItem (action: IAction, actionOptions?: IDropdownMenuActionViewItemOptions) { - const customAction = (options.actions ?? []).find(customAction => customAction.id === action.id) - if (customAction?.render != null) { - return new class extends BaseActionViewItem { - constructor () { super(null, action) } - override render = customAction!.render! - }() - } - return super.getActionViewItem(action, actionOptions) - } + public override getActionViewItem( + action: IAction, + actionOptions?: IDropdownMenuActionViewItemOptions + ) { + const customAction = (options.actions ?? []).find( + (customAction) => customAction.id === action.id + ) + if (customAction?.render != null) { + return new (class extends BaseActionViewItem { + constructor() { + super(null, action) + } + + override render = customAction!.render! + })() + } + return super.getActionViewItem(action, actionOptions) + } - protected override layoutBody (height: number, width: number): void { - const [wrapper, scrollbar] = assertAllDefined(this.wrapper, this.scrollbar) + protected override layoutBody(height: number, width: number): void { + const [wrapper, scrollbar] = assertAllDefined(this.wrapper, this.scrollbar) - // Pass on to Container - size(wrapper, width, height) + // Pass on to Container + size(wrapper, width, height) - // Adjust scrollbar - scrollbar.scanDomNode() - } - }), - canMoveView: options.canMoveView ?? true, - canToggleVisibility: options.canToggleVisibility ?? false, - hideByDefault: options.hideByDefault ?? false, - collapsed: options.collapsed ?? false, - order: options.order, - containerIcon: iconUrl - }] + // Adjust scrollbar + scrollbar.scanDomNode() + } + } + ), + canMoveView: options.canMoveView ?? true, + canToggleVisibility: options.canToggleVisibility ?? false, + hideByDefault: options.hideByDefault ?? false, + collapsed: options.collapsed ?? false, + order: options.order, + containerIcon: iconUrl + } + ] viewRegistry.registerViews(views, viewContainer) const disposableCollection = new DisposableStore() disposableCollection.add({ - dispose () { + dispose() { viewRegistry.deregisterViews(views, viewContainer) if (options.viewContainer == null) { // Only deregister if it's newly created @@ -367,37 +440,47 @@ function registerCustomView (options: CustomViewOption): IDisposable { }) for (const action of options.actions ?? []) { - disposableCollection.add(registerAction2(class extends Action2 { - constructor () { - super({ - id: action.id, - title: { value: action.title, original: action.title }, - category: Categories.View, - menu: [{ - id: MenuId.ViewTitle, - when: ContextKeyExpr.equals('view', options.id), - group: 'navigation', - order: action.order - }, { - id: MenuId.CommandPalette - }], - tooltip: action.tooltip, - icon: action.icon != null ? Codicon[action.icon] : undefined - }) - } + disposableCollection.add( + registerAction2( + class extends Action2 { + constructor() { + super({ + id: action.id, + title: { value: action.title, original: action.title }, + category: Categories.View, + menu: [ + { + id: MenuId.ViewTitle, + when: ContextKeyExpr.equals('view', options.id), + group: 'navigation', + order: action.order + }, + { + id: MenuId.CommandPalette + } + ], + tooltip: action.tooltip, + icon: action.icon != null ? Codicon[action.icon] : undefined + }) + } - run = action.run ?? (async () => {}) - })) + run = action.run ?? (async () => {}) + } + ) + ) } return disposableCollection } -export function isPartVisibile (part: Parts): boolean { +export function isPartVisibile(part: Parts): boolean { return StandaloneServices.get(IWorkbenchLayoutService).isVisible(part, window) } -export function setPartVisibility (part: Exclude, visible: boolean): void { +export function setPartVisibility( + part: Exclude, + visible: boolean +): void { StandaloneServices.get(IWorkbenchLayoutService).setPartHidden(!visible, part, window) } @@ -405,15 +488,17 @@ export const onDidChangePanelPosition: Event = (listener) => { return StandaloneServices.get(IWorkbenchLayoutService).onDidChangePanelPosition(listener) } -export function getPanelPosition (): Position { +export function getPanelPosition(): Position { return StandaloneServices.get(IWorkbenchLayoutService).getPanelPosition() } export const onDidChangeSideBarPosition: Event = (listener) => { - return (StandaloneServices.get(IWorkbenchLayoutService) as LayoutService).onDidChangeSideBarPosition(listener) + return ( + StandaloneServices.get(IWorkbenchLayoutService) as LayoutService + ).onDidChangeSideBarPosition(listener) } -export function getSideBarPosition (): Position { +export function getSideBarPosition(): Position { return StandaloneServices.get(IWorkbenchLayoutService).getSideBarPosition() } diff --git a/src/service-override/treesitter.ts b/src/service-override/treesitter.ts index 5ee92f83..53ff528f 100644 --- a/src/service-override/treesitter.ts +++ b/src/service-override/treesitter.ts @@ -8,14 +8,31 @@ import { registerAssets } from '../assets' import 'vs/workbench/services/treeSitter/browser/treeSitterTokenizationFeature.contribution' registerAssets({ - 'vs/../../node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter.wasm': new URL('@vscode/tree-sitter-wasm/wasm/tree-sitter.wasm', import.meta.url).href, - 'vs/../../node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-typescript.wasm': new URL('@vscode/tree-sitter-wasm/wasm/tree-sitter-typescript.wasm', import.meta.url).href, - 'vs/editor/common/languages/highlights/typescript.scm': new URL('../../vscode/src/vs/editor/common/languages/highlights/typescript.scm', import.meta.url).href + 'vs/../../node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter.wasm': new URL( + '@vscode/tree-sitter-wasm/wasm/tree-sitter.wasm', + import.meta.url + ).href, + 'vs/../../node_modules/@vscode/tree-sitter-wasm/wasm/tree-sitter-typescript.wasm': new URL( + '@vscode/tree-sitter-wasm/wasm/tree-sitter-typescript.wasm', + import.meta.url + ).href, + 'vs/editor/common/languages/highlights/typescript.scm': new URL( + '../../vscode/src/vs/editor/common/languages/highlights/typescript.scm', + import.meta.url + ).href }) -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { - [ITreeSitterParserService.toString()]: new SyncDescriptor(TreeSitterTextModelService, [], false), - [ITreeSitterTokenizationFeature.toString()]: new SyncDescriptor(TreeSitterTokenizationFeature, [], false) + [ITreeSitterParserService.toString()]: new SyncDescriptor( + TreeSitterTextModelService, + [], + false + ), + [ITreeSitterTokenizationFeature.toString()]: new SyncDescriptor( + TreeSitterTokenizationFeature, + [], + false + ) } } diff --git a/src/service-override/update.ts b/src/service-override/update.ts index 63b7d223..67ba923f 100644 --- a/src/service-override/update.ts +++ b/src/service-override/update.ts @@ -4,7 +4,7 @@ import { IUpdateService } from 'vs/platform/update/common/update.service' import { BrowserUpdateService } from 'vs/workbench/services/update/browser/updateService' import 'vs/workbench/contrib/update/browser/update.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IUpdateService.toString()]: new SyncDescriptor(BrowserUpdateService, [], true) } diff --git a/src/service-override/userDataProfile.ts b/src/service-override/userDataProfile.ts index 4141a8eb..b84e8611 100644 --- a/src/service-override/userDataProfile.ts +++ b/src/service-override/userDataProfile.ts @@ -1,9 +1,15 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IUserDataSyncStoreManagementService, IUserDataSyncUtilService } from 'vs/platform/userDataSync/common/userDataSync.service' +import { + IUserDataSyncStoreManagementService, + IUserDataSyncUtilService +} from 'vs/platform/userDataSync/common/userDataSync.service' import { BrowserUserDataProfilesService } from 'vs/platform/userDataProfile/browser/userDataProfile' import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile.service' -import { IUserDataInitializer, UserDataInitializationService } from 'vs/workbench/services/userData/browser/userDataInit' +import { + IUserDataInitializer, + UserDataInitializationService +} from 'vs/workbench/services/userData/browser/userDataInit' import { IUserDataInitializationService } from 'vs/workbench/services/userData/browser/userDataInit.service' import { UserDataSyncInitializer } from 'vs/workbench/services/userDataSync/browser/userDataSyncInit' import { UserDataProfileInitializer } from 'vs/workbench/services/userDataProfile/browser/userDataProfileInit' @@ -15,7 +21,11 @@ import { IProductService } from 'vs/platform/product/common/productService.servi import { IRequestService } from 'vs/platform/request/common/request.service' import { ILogService } from 'vs/platform/log/common/log.service' import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity.service' -import { IUserDataProfileImportExportService, IUserDataProfileManagementService, IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile.service' +import { + IUserDataProfileImportExportService, + IUserDataProfileManagementService, + IUserDataProfileService +} from 'vs/workbench/services/userDataProfile/common/userDataProfile.service' import { mark } from 'vs/base/common/performance' import type { WorkspaceService } from 'vs/workbench/services/configuration/browser/configurationService' import { timeout } from 'vs/base/common/async' @@ -32,11 +42,16 @@ import { registerServiceInitializePostParticipant } from '../lifecycle' import { getWorkspaceIdentifier } from '../workbench' import 'vs/workbench/contrib/userDataProfile/browser/userDataProfile.contribution' -function isWorkspaceService (configurationService: IWorkbenchConfigurationService): configurationService is WorkspaceService { +function isWorkspaceService( + configurationService: IWorkbenchConfigurationService +): configurationService is WorkspaceService { return 'reloadLocalUserConfiguration' in configurationService } -async function initializeUserData (userDataInitializationService: UserDataInitializationService, configurationService: IWorkbenchConfigurationService) { +async function initializeUserData( + userDataInitializationService: UserDataInitializationService, + configurationService: IWorkbenchConfigurationService +) { if (await userDataInitializationService.requiresInitialization()) { mark('code/willInitRequiredUserData') @@ -53,23 +68,27 @@ async function initializeUserData (userDataInitializationService: UserDataInitia } } -registerServiceInitializePostParticipant(async accessor => { +registerServiceInitializePostParticipant(async (accessor) => { try { await Promise.race([ // Do not block more than 5s timeout(5000), - initializeUserData(accessor.get(IUserDataInitializationService) as UserDataInitializationService, accessor.get(IWorkbenchConfigurationService))] - ) + initializeUserData( + accessor.get(IUserDataInitializationService) as UserDataInitializationService, + accessor.get(IWorkbenchConfigurationService) + ) + ]) } catch (error) { accessor.get(ILogService).error(error as Error) } }) class InjectedUserDataInitializationService extends UserDataInitializationService { - constructor ( + constructor( @IBrowserWorkbenchEnvironmentService environmentService: IBrowserWorkbenchEnvironmentService, @ISecretStorageService secretStorageService: ISecretStorageService, - @IUserDataSyncStoreManagementService userDataSyncStoreManagementService: IUserDataSyncStoreManagementService, + @IUserDataSyncStoreManagementService + userDataSyncStoreManagementService: IUserDataSyncStoreManagementService, @IFileService fileService: IFileService, @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, @IStorageService storageService: IStorageService, @@ -80,28 +99,60 @@ class InjectedUserDataInitializationService extends UserDataInitializationServic @IUserDataProfileService userDataProfileService: IUserDataProfileService ) { const userDataInitializers: IUserDataInitializer[] = [] - userDataInitializers.push(new UserDataSyncInitializer(environmentService, secretStorageService, userDataSyncStoreManagementService, fileService, userDataProfilesService, storageService, productService, requestService, logService, uriIdentityService)) + userDataInitializers.push( + new UserDataSyncInitializer( + environmentService, + secretStorageService, + userDataSyncStoreManagementService, + fileService, + userDataProfilesService, + storageService, + productService, + requestService, + logService, + uriIdentityService + ) + ) if (environmentService.options?.profile != null) { - userDataInitializers.push(new UserDataProfileInitializer(environmentService, fileService, userDataProfileService, storageService, logService, uriIdentityService, requestService)) + userDataInitializers.push( + new UserDataProfileInitializer( + environmentService, + fileService, + userDataProfileService, + storageService, + logService, + uriIdentityService, + requestService + ) + ) } super(userDataInitializers) } } -function getCurrentProfile (workspace: IAnyWorkspaceIdentifier, userDataProfilesService: BrowserUserDataProfilesService, environmentService: IBrowserWorkbenchEnvironmentService): IUserDataProfile { +function getCurrentProfile( + workspace: IAnyWorkspaceIdentifier, + userDataProfilesService: BrowserUserDataProfilesService, + environmentService: IBrowserWorkbenchEnvironmentService +): IUserDataProfile { if (environmentService.options?.profile != null) { - const profile = userDataProfilesService.profiles.find(p => p.name === environmentService.options?.profile?.name) + const profile = userDataProfilesService.profiles.find( + (p) => p.name === environmentService.options?.profile?.name + ) if (profile != null) { return profile } return userDataProfilesService.defaultProfile } - return userDataProfilesService.getProfileForWorkspace(workspace) ?? userDataProfilesService.defaultProfile + return ( + userDataProfilesService.getProfileForWorkspace(workspace) ?? + userDataProfilesService.defaultProfile + ) } class InjectedUserDataProfileService extends UserDataProfileService { - constructor ( + constructor( @IBrowserWorkbenchEnvironmentService environmentService: IBrowserWorkbenchEnvironmentService, @IUserDataProfilesService userDataProfilesService: BrowserUserDataProfilesService, @ILogService logService: ILogService @@ -110,24 +161,54 @@ class InjectedUserDataProfileService extends UserDataProfileService { const profile = getCurrentProfile(workspace, userDataProfilesService, environmentService) super(profile) - if (profile === userDataProfilesService.defaultProfile && environmentService.options?.profile != null) { - userDataProfilesService.createNamedProfile(environmentService.options.profile.name, undefined, workspace).then(async (profile) => { - await this.updateCurrentProfile(profile) - }).catch(err => { - logService.error(err) - }) + if ( + profile === userDataProfilesService.defaultProfile && + environmentService.options?.profile != null + ) { + userDataProfilesService + .createNamedProfile(environmentService.options.profile.name, undefined, workspace) + .then(async (profile) => { + await this.updateCurrentProfile(profile) + }) + .catch((err) => { + logService.error(err) + }) } } } -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { - [IUserDataProfileService.toString()]: new SyncDescriptor(InjectedUserDataProfileService, [], true), - [IUserDataProfilesService.toString()]: new SyncDescriptor(BrowserUserDataProfilesService, [], true), - [IUserDataInitializationService.toString()]: new SyncDescriptor(InjectedUserDataInitializationService, [], true), - [IUserDataProfileImportExportService.toString()]: new SyncDescriptor(UserDataProfileImportExportService, [], true), - [IUserDataProfileManagementService.toString()]: new SyncDescriptor(UserDataProfileManagementService, [], true), - [IUserDataProfileStorageService.toString()]: new SyncDescriptor(UserDataProfileStorageService, [], true), + [IUserDataProfileService.toString()]: new SyncDescriptor( + InjectedUserDataProfileService, + [], + true + ), + [IUserDataProfilesService.toString()]: new SyncDescriptor( + BrowserUserDataProfilesService, + [], + true + ), + [IUserDataInitializationService.toString()]: new SyncDescriptor( + InjectedUserDataInitializationService, + [], + true + ), + [IUserDataProfileImportExportService.toString()]: new SyncDescriptor( + UserDataProfileImportExportService, + [], + true + ), + [IUserDataProfileManagementService.toString()]: new SyncDescriptor( + UserDataProfileManagementService, + [], + true + ), + [IUserDataProfileStorageService.toString()]: new SyncDescriptor( + UserDataProfileStorageService, + [], + true + ), [IUserDataSyncUtilService.toString()]: new SyncDescriptor(UserDataSyncUtilService, [], true) } } diff --git a/src/service-override/userDataSync.ts b/src/service-override/userDataSync.ts index 9b4e3487..03bfd3a7 100644 --- a/src/service-override/userDataSync.ts +++ b/src/service-override/userDataSync.ts @@ -1,11 +1,23 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IUserDataAutoSyncService, IUserDataSyncEnablementService, IUserDataSyncLocalStoreService, IUserDataSyncLogService, IUserDataSyncResourceProviderService, IUserDataSyncService, IUserDataSyncStoreManagementService, IUserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSync.service' +import { + IUserDataAutoSyncService, + IUserDataSyncEnablementService, + IUserDataSyncLocalStoreService, + IUserDataSyncLogService, + IUserDataSyncResourceProviderService, + IUserDataSyncService, + IUserDataSyncStoreManagementService, + IUserDataSyncStoreService +} from 'vs/platform/userDataSync/common/userDataSync.service' import { UserDataSyncAccountService } from 'vs/platform/userDataSync/common/userDataSyncAccount' import { IUserDataSyncAccountService } from 'vs/platform/userDataSync/common/userDataSyncAccount.service' import { UserDataSyncMachinesService } from 'vs/platform/userDataSync/common/userDataSyncMachines' import { IUserDataSyncMachinesService } from 'vs/platform/userDataSync/common/userDataSyncMachines.service' -import { UserDataSyncStoreManagementService, UserDataSyncStoreService } from 'vs/platform/userDataSync/common/userDataSyncStoreService' +import { + UserDataSyncStoreManagementService, + UserDataSyncStoreService +} from 'vs/platform/userDataSync/common/userDataSyncStoreService' import { UserDataAutoSyncService } from 'vs/platform/userDataSync/common/userDataAutoSyncService' import { WebUserDataSyncEnablementService } from 'vs/workbench/services/userDataSync/browser/webUserDataSyncEnablementService' import { UserDataSyncService } from 'vs/platform/userDataSync/common/userDataSyncService' @@ -17,19 +29,47 @@ import { IUserDataSyncWorkbenchService } from 'vs/workbench/services/userDataSyn import getUserDataProfileServiceOverride from './userDataProfile' import 'vs/workbench/contrib/userDataSync/browser/userDataSync.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { ...getUserDataProfileServiceOverride(), [IUserDataAutoSyncService.toString()]: new SyncDescriptor(UserDataAutoSyncService, [], true), - [IUserDataSyncStoreManagementService.toString()]: new SyncDescriptor(UserDataSyncStoreManagementService, [], true), + [IUserDataSyncStoreManagementService.toString()]: new SyncDescriptor( + UserDataSyncStoreManagementService, + [], + true + ), [IUserDataSyncStoreService.toString()]: new SyncDescriptor(UserDataSyncStoreService, [], true), - [IUserDataSyncEnablementService.toString()]: new SyncDescriptor(WebUserDataSyncEnablementService, [], true), + [IUserDataSyncEnablementService.toString()]: new SyncDescriptor( + WebUserDataSyncEnablementService, + [], + true + ), [IUserDataSyncService.toString()]: new SyncDescriptor(UserDataSyncService, [], true), [IUserDataSyncLogService.toString()]: new SyncDescriptor(UserDataSyncLogService, [], true), - [IUserDataSyncAccountService.toString()]: new SyncDescriptor(UserDataSyncAccountService, [], true), - [IUserDataSyncMachinesService.toString()]: new SyncDescriptor(UserDataSyncMachinesService, [], true), - [IUserDataSyncResourceProviderService.toString()]: new SyncDescriptor(UserDataSyncResourceProviderService, [], true), - [IUserDataSyncLocalStoreService.toString()]: new SyncDescriptor(UserDataSyncLocalStoreService, [], true), - [IUserDataSyncWorkbenchService.toString()]: new SyncDescriptor(UserDataSyncWorkbenchService, [], true) + [IUserDataSyncAccountService.toString()]: new SyncDescriptor( + UserDataSyncAccountService, + [], + true + ), + [IUserDataSyncMachinesService.toString()]: new SyncDescriptor( + UserDataSyncMachinesService, + [], + true + ), + [IUserDataSyncResourceProviderService.toString()]: new SyncDescriptor( + UserDataSyncResourceProviderService, + [], + true + ), + [IUserDataSyncLocalStoreService.toString()]: new SyncDescriptor( + UserDataSyncLocalStoreService, + [], + true + ), + [IUserDataSyncWorkbenchService.toString()]: new SyncDescriptor( + UserDataSyncWorkbenchService, + [], + true + ) } } diff --git a/src/service-override/viewBanner.ts b/src/service-override/viewBanner.ts index d1988945..bc8a3f09 100644 --- a/src/service-override/viewBanner.ts +++ b/src/service-override/viewBanner.ts @@ -5,16 +5,14 @@ import { IBannerService } from 'vs/workbench/services/banner/browser/bannerServi import { registerServiceInitializePostParticipant } from '../lifecycle' import 'vs/workbench/contrib/welcomeBanner/browser/welcomeBanner.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IBannerService.toString()]: new SyncDescriptor(BannerPart, [], false) } } -registerServiceInitializePostParticipant(async accessor => { +registerServiceInitializePostParticipant(async (accessor) => { accessor.get(IBannerService) }) -export { - BannerPart -} +export { BannerPart } diff --git a/src/service-override/viewCommon.ts b/src/service-override/viewCommon.ts index 993ded89..d7b99587 100644 --- a/src/service-override/viewCommon.ts +++ b/src/service-override/viewCommon.ts @@ -71,13 +71,35 @@ import 'vs/workbench/browser/parts/editor/editorParts' let webviewIframeAlternateDomains: string | undefined registerAssets({ - 'vs/workbench/contrib/webview/browser/pre/service-worker.js': () => changeUrlDomain(new URL('../../vscode/src/vs/workbench/contrib/webview/browser/pre/service-worker.js', import.meta.url).href, webviewIframeAlternateDomains), - 'vs/workbench/contrib/webview/browser/pre/index.html': () => changeUrlDomain(new URL('../assets/webview/index.html', import.meta.url).href, webviewIframeAlternateDomains), - 'vs/workbench/contrib/webview/browser/pre/index-no-csp.html': () => changeUrlDomain(new URL('../assets/webview/index-no-csp.html', import.meta.url).href, webviewIframeAlternateDomains), - 'vs/workbench/contrib/webview/browser/pre/fake.html': () => changeUrlDomain(new URL('../../vscode/src/vs/workbench/contrib/webview/browser/pre/fake.html', import.meta.url).href, webviewIframeAlternateDomains) + 'vs/workbench/contrib/webview/browser/pre/service-worker.js': () => + changeUrlDomain( + new URL( + '../../vscode/src/vs/workbench/contrib/webview/browser/pre/service-worker.js', + import.meta.url + ).href, + webviewIframeAlternateDomains + ), + 'vs/workbench/contrib/webview/browser/pre/index.html': () => + changeUrlDomain( + new URL('../assets/webview/index.html', import.meta.url).href, + webviewIframeAlternateDomains + ), + 'vs/workbench/contrib/webview/browser/pre/index-no-csp.html': () => + changeUrlDomain( + new URL('../assets/webview/index-no-csp.html', import.meta.url).href, + webviewIframeAlternateDomains + ), + 'vs/workbench/contrib/webview/browser/pre/fake.html': () => + changeUrlDomain( + new URL( + '../../vscode/src/vs/workbench/contrib/webview/browser/pre/fake.html', + import.meta.url + ).href, + webviewIframeAlternateDomains + ) }) -function getServiceOverride (_webviewIframeAlternateDomains?: string): IEditorOverrideServices { +function getServiceOverride(_webviewIframeAlternateDomains?: string): IEditorOverrideServices { if (_webviewIframeAlternateDomains != null) { webviewIframeAlternateDomains = _webviewIframeAlternateDomains } @@ -94,14 +116,22 @@ function getServiceOverride (_webviewIframeAlternateDomains?: string): IEditorOv [IEditorResolverService.toString()]: new SyncDescriptor(EditorResolverService, [], false), [IBreadcrumbsService.toString()]: new SyncDescriptor(BreadcrumbsService, [], true), [IContextViewService.toString()]: new SyncDescriptor(ContextViewService, [], true), - [IUntitledTextEditorService.toString()]: new SyncDescriptor(UntitledTextEditorService, [], true), + [IUntitledTextEditorService.toString()]: new SyncDescriptor( + UntitledTextEditorService, + [], + true + ), [IHistoryService.toString()]: new SyncDescriptor(HistoryService, [], false), [ICustomEditorService.toString()]: new SyncDescriptor(CustomEditorService, [], true), [IWebviewService.toString()]: new SyncDescriptor(WebviewService, [], true), [IWebviewViewService.toString()]: new SyncDescriptor(WebviewViewService, [], true), [IWebviewWorkbenchService.toString()]: new SyncDescriptor(WebviewEditorService, [], true), [IProgressService.toString()]: new SyncDescriptor(ProgressService, [], true), - [IAuxiliaryWindowService.toString()]: new SyncDescriptor(BrowserAuxiliaryWindowService, [], true), + [IAuxiliaryWindowService.toString()]: new SyncDescriptor( + BrowserAuxiliaryWindowService, + [], + true + ), [IEditorPaneService.toString()]: new SyncDescriptor(EditorPaneService, [], true), [ICustomEditorLabelService.toString()]: new SyncDescriptor(CustomEditorLabelService, [], true), [IActionViewItemService.toString()]: new SyncDescriptor(ActionViewItemService, [], true) diff --git a/src/service-override/viewStatusBar.ts b/src/service-override/viewStatusBar.ts index b519561b..57d253cf 100644 --- a/src/service-override/viewStatusBar.ts +++ b/src/service-override/viewStatusBar.ts @@ -2,12 +2,19 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standalone import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { StatusbarService } from 'vs/workbench/browser/parts/statusbar/statusbarPart' import { IStatusbarService } from 'vs/workbench/services/statusbar/browser/statusbar.service' -import { ExtensionStatusBarItemService, IExtensionStatusBarItemService } from 'vs/workbench/api/browser/statusBarService' +import { + ExtensionStatusBarItemService, + IExtensionStatusBarItemService +} from 'vs/workbench/api/browser/statusBarService' import 'vs/workbench/api/browser/statusBarExtensionPoint' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IStatusbarService.toString()]: new SyncDescriptor(StatusbarService, [], false), - [IExtensionStatusBarItemService.toString()]: new SyncDescriptor(ExtensionStatusBarItemService, [], false) + [IExtensionStatusBarItemService.toString()]: new SyncDescriptor( + ExtensionStatusBarItemService, + [], + false + ) } } diff --git a/src/service-override/viewTitleBar.ts b/src/service-override/viewTitleBar.ts index df3d4fea..c2051621 100644 --- a/src/service-override/viewTitleBar.ts +++ b/src/service-override/viewTitleBar.ts @@ -4,12 +4,12 @@ import { BrowserTitleService } from 'vs/workbench/browser/parts/titlebar/titleba import { ITitleService } from 'vs/workbench/services/title/browser/titleService.service' import { registerServiceInitializePostParticipant } from '../lifecycle' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [ITitleService.toString()]: new SyncDescriptor(BrowserTitleService, [], false) } } -registerServiceInitializePostParticipant(async accessor => { +registerServiceInitializePostParticipant(async (accessor) => { accessor.get(ITitleService) }) diff --git a/src/service-override/views.ts b/src/service-override/views.ts index 06e7863b..8a1450c3 100644 --- a/src/service-override/views.ts +++ b/src/service-override/views.ts @@ -1,4 +1,7 @@ -import { IEditorOverrideServices, StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices' +import { + IEditorOverrideServices, + StandaloneServices +} from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { ViewContainerLocation } from 'vs/workbench/common/views' import { IViewDescriptorService } from 'vs/workbench/common/views.service' @@ -12,13 +15,25 @@ import { PanelPart } from 'vs/workbench/browser/parts/panel/panelPart' import { URI } from 'vs/base/common/uri' import { Part } from 'vs/workbench/browser/part' import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart' -import { GroupOrientation, GroupsOrder } from 'vs/workbench/services/editor/common/editorGroupsService' +import { + GroupOrientation, + GroupsOrder +} from 'vs/workbench/services/editor/common/editorGroupsService' import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' -import { GroupIdentifier, IUntypedEditorInput, isResourceEditorInput, pathsToEditors } from 'vs/workbench/common/editor' +import { + GroupIdentifier, + IUntypedEditorInput, + isResourceEditorInput, + pathsToEditors +} from 'vs/workbench/common/editor' import { IEditorOptions } from 'vs/platform/editor/common/editor' import { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService' -import { Parts, Position, positionToString } from 'vs/workbench/services/layout/browser/layoutService' +import { + Parts, + Position, + positionToString +} from 'vs/workbench/services/layout/browser/layoutService' import { StorageScope } from 'vs/platform/storage/common/storage' import { IStorageService } from 'vs/platform/storage/common/storage.service' import { IFileService } from 'vs/platform/files/common/files.service' @@ -32,7 +47,11 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten import { Promises } from 'vs/base/common/async' import { isWeb } from 'vs/base/common/platform' import { IEnvironmentService } from 'vs/platform/environment/common/environment.service' -import { IEditorToOpen, IInitialEditorsState, ILayoutInitializationState } from 'vs/workbench/browser/layout' +import { + IEditorToOpen, + IInitialEditorsState, + ILayoutInitializationState +} from 'vs/workbench/browser/layout' import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService.service' import { WorkbenchState, isTemporaryWorkspace } from 'vs/platform/workspace/common/workspace' import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace.service' @@ -51,8 +70,10 @@ import { onRenderWorkbench } from '../lifecycle' import { RawContextKey } from '../monaco' export * from './tools/views' -function createPart (id: string, role: string, classes: string[]): HTMLElement { - const part = document.createElement(role === 'status' ? 'footer' /* Use footer element for status bar #98376 */ : 'div') +function createPart(id: string, role: string, classes: string[]): HTMLElement { + const part = document.createElement( + role === 'status' ? 'footer' /* Use footer element for status bar #98376 */ : 'div' + ) part.classList.add('part', 'monaco-workbench-part', ...classes) part.id = id part.setAttribute('role', role) @@ -63,7 +84,7 @@ function createPart (id: string, role: string, classes: string[]): HTMLElement { return part } -function layoutPart (part: Part) { +function layoutPart(part: Part) { const parent = part.getContainer()?.parentNode as HTMLElement | undefined if (parent == null) { return @@ -71,13 +92,14 @@ function layoutPart (part: Part) { part.layout( Math.max(part.minimumWidth, Math.min(part.maximumWidth, parent.offsetWidth)), Math.max(part.minimumHeight, Math.min(part.maximumHeight, parent.offsetHeight)), - parent.offsetTop, parent.offsetLeft + parent.offsetTop, + parent.offsetLeft ) } -function renderPart (partContainer: HTMLElement, part: Part): void { +function renderPart(partContainer: HTMLElement, part: Part): void { partContainer.oncontextmenu = () => false - function layout () { + function layout() { layoutPart(part) } part.onDidVisibilityChange((visible) => { @@ -88,23 +110,23 @@ function renderPart (partContainer: HTMLElement, part: Part): void { layout() } -function getPart (part: Parts): Part | undefined { +function getPart(part: Parts): Part | undefined { return (StandaloneServices.get(ILayoutService) as LayoutService).getPart(part) } -function _attachPart (part: Part, container: HTMLElement) { +function _attachPart(part: Part, container: HTMLElement) { container.append(part.getContainer()!) const observer = new ResizeObserver(() => layoutPart(part)) observer.observe(container) return { - dispose () { + dispose() { return observer.disconnect() } } } -function attachPart (part: Parts, container: HTMLElement): IDisposable { +function attachPart(part: Parts, container: HTMLElement): IDisposable { const _part = getPart(part) if (_part == null) { throw new Error('Part not found') @@ -112,7 +134,7 @@ function attachPart (part: Parts, container: HTMLElement): IDisposable { return _attachPart(_part, container) } -function onPartVisibilityChange (part: Parts, listener: (visible: boolean) => void): IDisposable { +function onPartVisibilityChange(part: Parts, listener: (visible: boolean) => void): IDisposable { const _part = getPart(part) if (_part == null) { throw new Error('Part not found') @@ -120,31 +142,31 @@ function onPartVisibilityChange (part: Parts, listener: (visible: boolean) => vo return _part.onDidVisibilityChange(listener) } -function renderActivitybarPar (container: HTMLElement): IDisposable { +function renderActivitybarPar(container: HTMLElement): IDisposable { return attachPart(Parts.ACTIVITYBAR_PART, container) } -function renderSidebarPart (container: HTMLElement): IDisposable { +function renderSidebarPart(container: HTMLElement): IDisposable { return attachPart(Parts.SIDEBAR_PART, container) } -function renderPanelPart (container: HTMLElement): IDisposable { +function renderPanelPart(container: HTMLElement): IDisposable { return attachPart(Parts.PANEL_PART, container) } -function renderAuxiliaryPart (container: HTMLElement): IDisposable { +function renderAuxiliaryPart(container: HTMLElement): IDisposable { return attachPart(Parts.AUXILIARYBAR_PART, container) } -function renderEditorPart (container: HTMLElement): IDisposable { +function renderEditorPart(container: HTMLElement): IDisposable { return attachPart(Parts.EDITOR_PART, container) } -function renderStatusBarPart (container: HTMLElement): IDisposable { +function renderStatusBarPart(container: HTMLElement): IDisposable { return attachPart(Parts.STATUSBAR_PART, container) } -function isElementVisible (el: HTMLElement) { +function isElementVisible(el: HTMLElement) { if (!el.isConnected) { return false } @@ -159,30 +181,30 @@ function isElementVisible (el: HTMLElement) { return el.offsetHeight > 0 && el.offsetWidth > 0 } -function isEditorPartVisible (): boolean { - const container = (StandaloneServices.get(IEditorGroupsService).mainPart as EditorPart).getContainer() +function isEditorPartVisible(): boolean { + const container = ( + StandaloneServices.get(IEditorGroupsService).mainPart as EditorPart + ).getContainer() return container != null && isElementVisible(container) } type PublicInterface = Pick -class MonacoEditorParts extends MonacoDelegateEditorGroupsService implements Omit, keyof IEditorGroupsService> { - constructor (@IInstantiationService instantiationService: IInstantiationService) { - super( - instantiationService.createInstance(EditorParts), - false, - instantiationService - ) +class MonacoEditorParts + extends MonacoDelegateEditorGroupsService + implements Omit, keyof IEditorGroupsService> +{ + constructor(@IInstantiationService instantiationService: IInstantiationService) { + super(instantiationService.createInstance(EditorParts), false, instantiationService) } - getId (): string { + getId(): string { return 'standalone' } - updateStyles (): void { - } + updateStyles(): void {} - registerPart (part: EditorPart): IDisposable { + registerPart(part: EditorPart): IDisposable { return this.delegate.registerPart(part) } @@ -190,17 +212,22 @@ class MonacoEditorParts extends MonacoDelegateEditorGroupsService i return this.delegate.restoreGroup(...args) } - bind (contextKey: RawContextKey, group: IEditorGroupView): IContextKey { + bind( + contextKey: RawContextKey, + group: IEditorGroupView + ): IContextKey { return this.delegate.bind(contextKey, group) } - get activePart (): EditorPart { + get activePart(): EditorPart { return this.delegate.activePart } } -type InitializationStateTransformer = (state: ILayoutInitializationState) => ILayoutInitializationState -let transformInitializationState: InitializationStateTransformer = state => state +type InitializationStateTransformer = ( + state: ILayoutInitializationState +) => ILayoutInitializationState +let transformInitializationState: InitializationStateTransformer = (state) => state onRenderWorkbench(async (accessor) => { const paneCompositePartService = accessor.get(IPaneCompositePartService) @@ -211,7 +238,9 @@ onRenderWorkbench(async (accessor) => { const editorService = accessor.get(IEditorService) const logService = accessor.get(ILogService) const extensionService = accessor.get(IExtensionService) - const environmentService = accessor.get(IEnvironmentService) as IBrowserWorkbenchEnvironmentService + const environmentService = accessor.get( + IEnvironmentService + ) as IBrowserWorkbenchEnvironmentService const contextService = accessor.get(IWorkspaceContextService) const configurationService = accessor.get(IConfigurationService) const fileService = accessor.get(IFileService) @@ -220,13 +249,17 @@ onRenderWorkbench(async (accessor) => { // force service instantiation const layoutService = accessor.get(ILayoutService) as LayoutService - function getInitialEditorsState (): IInitialEditorsState | undefined { + function getInitialEditorsState(): IInitialEditorsState | undefined { // Check for editors / editor layout from `defaultLayout` options first const defaultLayout = environmentService.options?.defaultLayout - if (((defaultLayout?.editors != null && defaultLayout.editors.length > 0) || defaultLayout?.layout?.editors != null) && ((defaultLayout.force ?? false) || storageService.isNew(StorageScope.WORKSPACE))) { + if ( + ((defaultLayout?.editors != null && defaultLayout.editors.length > 0) || + defaultLayout?.layout?.editors != null) && + ((defaultLayout.force ?? false) || storageService.isNew(StorageScope.WORKSPACE)) + ) { return { layout: defaultLayout.layout?.editors, - filesToOpenOrCreate: defaultLayout.editors?.map(editor => { + filesToOpenOrCreate: defaultLayout.editors?.map((editor) => { return { viewColumn: editor.viewColumn, fileUri: URI.revive(editor.uri), @@ -246,7 +279,10 @@ onRenderWorkbench(async (accessor) => { return undefined } - function getDefaultLayoutViews (environmentService: IBrowserWorkbenchEnvironmentService, storageService: IStorageService): string[] | undefined { + function getDefaultLayoutViews( + environmentService: IBrowserWorkbenchEnvironmentService, + storageService: IStorageService + ): string[] | undefined { const defaultLayout = environmentService.options?.defaultLayout if (defaultLayout == null) { return undefined @@ -258,52 +294,77 @@ onRenderWorkbench(async (accessor) => { const { views } = defaultLayout if (views != null && views.length > 0) { - return views.map(view => view.id) + return views.map((view) => view.id) } return undefined } - function shouldRestoreEditors (contextService: IWorkspaceContextService, initialEditorsState: IInitialEditorsState | undefined): boolean { + function shouldRestoreEditors( + contextService: IWorkspaceContextService, + initialEditorsState: IInitialEditorsState | undefined + ): boolean { if (isTemporaryWorkspace(contextService.getWorkspace())) { return false } - const forceRestoreEditors = configurationService.getValue('window.restoreWindows') === 'preserve' + const forceRestoreEditors = + configurationService.getValue('window.restoreWindows') === 'preserve' return !!forceRestoreEditors || initialEditorsState === undefined } - async function resolveEditorsToOpen (fileService: IFileService, initialEditorsState: IInitialEditorsState | undefined): Promise { + async function resolveEditorsToOpen( + fileService: IFileService, + initialEditorsState: IInitialEditorsState | undefined + ): Promise { if (initialEditorsState != null) { // Merge editor (single) - const filesToMerge = coalesce(await pathsToEditors(initialEditorsState.filesToMerge, fileService, logService)) - if (filesToMerge.length === 4 && isResourceEditorInput(filesToMerge[0]) && isResourceEditorInput(filesToMerge[1]) && isResourceEditorInput(filesToMerge[2]) && isResourceEditorInput(filesToMerge[3])) { - return [{ - editor: { - input1: { resource: filesToMerge[0].resource }, - input2: { resource: filesToMerge[1].resource }, - base: { resource: filesToMerge[2].resource }, - result: { resource: filesToMerge[3].resource }, - options: { pinned: true } + const filesToMerge = coalesce( + await pathsToEditors(initialEditorsState.filesToMerge, fileService, logService) + ) + if ( + filesToMerge.length === 4 && + isResourceEditorInput(filesToMerge[0]) && + isResourceEditorInput(filesToMerge[1]) && + isResourceEditorInput(filesToMerge[2]) && + isResourceEditorInput(filesToMerge[3]) + ) { + return [ + { + editor: { + input1: { resource: filesToMerge[0].resource }, + input2: { resource: filesToMerge[1].resource }, + base: { resource: filesToMerge[2].resource }, + result: { resource: filesToMerge[3].resource }, + options: { pinned: true } + } } - }] + ] } // Diff editor (single) - const filesToDiff = coalesce(await pathsToEditors(initialEditorsState.filesToDiff, fileService, logService)) + const filesToDiff = coalesce( + await pathsToEditors(initialEditorsState.filesToDiff, fileService, logService) + ) if (filesToDiff.length === 2) { - return [{ - editor: { - original: { resource: filesToDiff[0]!.resource }, - modified: { resource: filesToDiff[1]!.resource }, - options: { pinned: true } + return [ + { + editor: { + original: { resource: filesToDiff[0]!.resource }, + modified: { resource: filesToDiff[1]!.resource }, + options: { pinned: true } + } } - }] + ] } // Normal editor (multiple) const filesToOpenOrCreate: IEditorToOpen[] = [] - const resolvedFilesToOpenOrCreate = await pathsToEditors(initialEditorsState.filesToOpenOrCreate, fileService, logService) + const resolvedFilesToOpenOrCreate = await pathsToEditors( + initialEditorsState.filesToOpenOrCreate, + fileService, + logService + ) for (let i = 0; i < resolvedFilesToOpenOrCreate.length; i++) { const resolvedFileToOpenOrCreate = resolvedFilesToOpenOrCreate[i] if (resolvedFileToOpenOrCreate != null) { @@ -315,7 +376,10 @@ onRenderWorkbench(async (accessor) => { } return filesToOpenOrCreate - } else if (contextService.getWorkbenchState() === WorkbenchState.EMPTY && configurationService.getValue('workbench.startupEditor') === 'newUntitledFile') { + } else if ( + contextService.getWorkbenchState() === WorkbenchState.EMPTY && + configurationService.getValue('workbench.startupEditor') === 'newUntitledFile' + ) { if (editorGroupService.mainPart.hasRestorableState) { return [] // do not open any empty untitled file if we restored groups/editors from previous session } @@ -325,9 +389,11 @@ onRenderWorkbench(async (accessor) => { return [] // do not open any empty untitled file if we have backups to restore } - return [{ - editor: { resource: undefined } // open empty untitled file - }] + return [ + { + editor: { resource: undefined } // open empty untitled file + } + ] } return [] @@ -351,16 +417,27 @@ onRenderWorkbench(async (accessor) => { } } - function getDefaultViewContainer (location: ViewContainerLocation) { - return viewDescriptorService.getDefaultViewContainer(location) ?? viewDescriptorService.getViewContainersByLocation(location)[0] + function getDefaultViewContainer(location: ViewContainerLocation) { + return ( + viewDescriptorService.getDefaultViewContainer(location) ?? + viewDescriptorService.getViewContainersByLocation(location)[0] + ) } - function initLayoutState () { + function initLayoutState() { if (layoutService.isVisible(Parts.SIDEBAR_PART)) { // Only restore last viewlet if window was reloaded or we are in development mode let viewContainerToRestore: string | undefined - if (!environmentService.isBuilt || lifecycleService.startupKind === StartupKind.ReloadedWindow || isWeb) { - viewContainerToRestore = storageService.get(SidebarPart.activeViewletSettingsKey, StorageScope.WORKSPACE, getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id) + if ( + !environmentService.isBuilt || + lifecycleService.startupKind === StartupKind.ReloadedWindow || + isWeb + ) { + viewContainerToRestore = storageService.get( + SidebarPart.activeViewletSettingsKey, + StorageScope.WORKSPACE, + getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id + ) } else { viewContainerToRestore = getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id } @@ -370,14 +447,22 @@ onRenderWorkbench(async (accessor) => { // Panel View Container To Restore if (layoutService.isVisible(Parts.PANEL_PART)) { - const viewContainerToRestore = storageService.get(PanelPart.activePanelSettingsKey, StorageScope.WORKSPACE, getDefaultViewContainer(ViewContainerLocation.Panel)?.id) + const viewContainerToRestore = storageService.get( + PanelPart.activePanelSettingsKey, + StorageScope.WORKSPACE, + getDefaultViewContainer(ViewContainerLocation.Panel)?.id + ) initialLayoutState.views.containerToRestore.panel = viewContainerToRestore } // Auxiliary Panel to restore if (layoutService.isVisible(Parts.AUXILIARYBAR_PART)) { - const viewContainerToRestore = storageService.get(AuxiliaryBarPart.activePanelSettingsKey, StorageScope.WORKSPACE, getDefaultViewContainer(ViewContainerLocation.AuxiliaryBar)?.id) + const viewContainerToRestore = storageService.get( + AuxiliaryBarPart.activePanelSettingsKey, + StorageScope.WORKSPACE, + getDefaultViewContainer(ViewContainerLocation.AuxiliaryBar)?.id + ) initialLayoutState.views.containerToRestore.auxiliaryBar = viewContainerToRestore } @@ -407,11 +492,41 @@ onRenderWorkbench(async (accessor) => { for (const { id, role, classes, options, getPosition, onDidChangePosition } of [ { id: Parts.TITLEBAR_PART, role: 'none', classes: ['titlebar'] }, { id: Parts.BANNER_PART, role: 'banner', classes: ['banner'] }, - { id: Parts.ACTIVITYBAR_PART, role: 'none', classes: ['activitybar'], getPosition: () => layoutService.getSideBarPosition(), onDidChangePosition: layoutService.onDidChangeSideBarPosition }, - { id: Parts.SIDEBAR_PART, role: 'none', classes: ['sidebar'], getPosition: () => layoutService.getSideBarPosition(), onDidChangePosition: layoutService.onDidChangeSideBarPosition }, - { id: Parts.EDITOR_PART, role: 'main', classes: ['editor'], options: { restorePreviousState: initialLayoutState.editor.restoreEditors } }, - { id: Parts.PANEL_PART, role: 'none', classes: ['panel', 'basepanel'], getPosition: () => layoutService.getPanelPosition(), onDidChangePosition: layoutService.onDidChangePanelPosition }, - { id: Parts.AUXILIARYBAR_PART, role: 'none', classes: ['auxiliarybar', 'basepanel'], getPosition: () => layoutService.getSideBarPosition() === Position.LEFT ? Position.RIGHT : Position.LEFT, onDidChangePosition: layoutService.onDidChangeSideBarPosition }, + { + id: Parts.ACTIVITYBAR_PART, + role: 'none', + classes: ['activitybar'], + getPosition: () => layoutService.getSideBarPosition(), + onDidChangePosition: layoutService.onDidChangeSideBarPosition + }, + { + id: Parts.SIDEBAR_PART, + role: 'none', + classes: ['sidebar'], + getPosition: () => layoutService.getSideBarPosition(), + onDidChangePosition: layoutService.onDidChangeSideBarPosition + }, + { + id: Parts.EDITOR_PART, + role: 'main', + classes: ['editor'], + options: { restorePreviousState: initialLayoutState.editor.restoreEditors } + }, + { + id: Parts.PANEL_PART, + role: 'none', + classes: ['panel', 'basepanel'], + getPosition: () => layoutService.getPanelPosition(), + onDidChangePosition: layoutService.onDidChangePanelPosition + }, + { + id: Parts.AUXILIARYBAR_PART, + role: 'none', + classes: ['auxiliarybar', 'basepanel'], + getPosition: () => + layoutService.getSideBarPosition() === Position.LEFT ? Position.RIGHT : Position.LEFT, + onDidChangePosition: layoutService.onDidChangeSideBarPosition + }, { id: Parts.STATUSBAR_PART, role: 'status', classes: ['statusbar'] } ]) { const part = layoutService.getPart(id) @@ -442,83 +557,89 @@ onRenderWorkbench(async (accessor) => { const layoutRestoredPromises: Promise[] = [] // Restore editors - layoutReadyPromises.push((async () => { - mark('code/willRestoreEditors') + layoutReadyPromises.push( + (async () => { + mark('code/willRestoreEditors') - // first ensure the editor part is ready - await editorGroupService.mainPart.whenReady - mark('code/restoreEditors/editorGroupsReady') + // first ensure the editor part is ready + await editorGroupService.mainPart.whenReady + mark('code/restoreEditors/editorGroupsReady') - // apply editor layout if any - if (initialLayoutState.layout?.editors != null) { - editorGroupService.applyLayout(initialLayoutState.layout.editors) - } + // apply editor layout if any + if (initialLayoutState.layout?.editors != null) { + editorGroupService.applyLayout(initialLayoutState.layout.editors) + } - // then see for editors to open as instructed - // it is important that we trigger this from - // the overall restore flow to reduce possible - // flicker on startup: we want any editor to - // open to get a chance to open first before - // signaling that layout is restored, but we do - // not need to await the editors from having - // fully loaded. - - const editors = await initialLayoutState.editor.editorsToOpen - mark('code/restoreEditors/editorsToOpenResolved') - - let openEditorsPromise: Promise | undefined - if (editors.length > 0) { - // we have to map editors to their groups as instructed - // by the input. this is important to ensure that we open - // the editors in the groups they belong to. - - const editorGroupsInVisualOrder = editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE) - const mapEditorsToGroup = new Map>() - - for (const editor of editors) { - const group = editorGroupsInVisualOrder[(editor.viewColumn ?? 1) - 1]! // viewColumn is index+1 based - - let editorsByGroup = mapEditorsToGroup.get(group.id) - if (editorsByGroup == null) { - editorsByGroup = new Set() - mapEditorsToGroup.set(group.id, editorsByGroup) + // then see for editors to open as instructed + // it is important that we trigger this from + // the overall restore flow to reduce possible + // flicker on startup: we want any editor to + // open to get a chance to open first before + // signaling that layout is restored, but we do + // not need to await the editors from having + // fully loaded. + + const editors = await initialLayoutState.editor.editorsToOpen + mark('code/restoreEditors/editorsToOpenResolved') + + let openEditorsPromise: Promise | undefined + if (editors.length > 0) { + // we have to map editors to their groups as instructed + // by the input. this is important to ensure that we open + // the editors in the groups they belong to. + + const editorGroupsInVisualOrder = editorGroupService.getGroups(GroupsOrder.GRID_APPEARANCE) + const mapEditorsToGroup = new Map>() + + for (const editor of editors) { + const group = editorGroupsInVisualOrder[(editor.viewColumn ?? 1) - 1]! // viewColumn is index+1 based + + let editorsByGroup = mapEditorsToGroup.get(group.id) + if (editorsByGroup == null) { + editorsByGroup = new Set() + mapEditorsToGroup.set(group.id, editorsByGroup) + } + + editorsByGroup.add(editor.editor) } - editorsByGroup.add(editor.editor) + openEditorsPromise = Promise.all( + Array.from(mapEditorsToGroup).map(async ([groupId, editors]) => { + try { + await editorService.openEditors(Array.from(editors), groupId, { validateTrust: true }) + } catch (error) { + logService.error(error) + } + }) + ) } - openEditorsPromise = Promise.all(Array.from(mapEditorsToGroup).map(async ([groupId, editors]) => { - try { - await editorService.openEditors(Array.from(editors), groupId, { validateTrust: true }) - } catch (error) { - logService.error(error) - } - })) - } - - // do not block the overall layout ready flow from potentially - // slow editors to resolve on startup - layoutRestoredPromises.push( - Promise.all([ - openEditorsPromise?.finally(() => mark('code/restoreEditors/editorsOpened')), - editorGroupService.mainPart.whenRestored.finally(() => mark('code/restoreEditors/editorGroupsRestored')) - ]).finally(() => { - // the `code/didRestoreEditors` perf mark is specifically - // for when visible editors have resolved, so we only mark - // if when editor group service has restored. - mark('code/didRestoreEditors') - }) - ) - })()) + // do not block the overall layout ready flow from potentially + // slow editors to resolve on startup + layoutRestoredPromises.push( + Promise.all([ + openEditorsPromise?.finally(() => mark('code/restoreEditors/editorsOpened')), + editorGroupService.mainPart.whenRestored.finally(() => + mark('code/restoreEditors/editorGroupsRestored') + ) + ]).finally(() => { + // the `code/didRestoreEditors` perf mark is specifically + // for when visible editors have resolved, so we only mark + // if when editor group service has restored. + mark('code/didRestoreEditors') + }) + ) + })() + ) // Restore default views (only when `IDefaultLayout` is provided) const restoreDefaultViewsPromise = (async () => { if (initialLayoutState.views.defaults != null && initialLayoutState.views.defaults.length > 0) { mark('code/willOpenDefaultViews') - const locationsRestored: { id: string, order: number }[] = [] + const locationsRestored: { id: string; order: number }[] = [] - const tryOpenView = (view: { id: string, order: number }): boolean => { + const tryOpenView = (view: { id: string; order: number }): boolean => { const location = viewDescriptorService.getViewLocationById(view.id) if (location !== null) { const container = viewDescriptorService.getViewContainerByViewId(view.id) @@ -538,7 +659,9 @@ onRenderWorkbench(async (accessor) => { return false } - const defaultViews = [...initialLayoutState.views.defaults].reverse().map((v, index) => ({ id: v, order: index })) + const defaultViews = [...initialLayoutState.views.defaults] + .reverse() + .map((v, index) => ({ id: v, order: index })) let i = defaultViews.length while (i > 0) { @@ -563,17 +686,20 @@ onRenderWorkbench(async (accessor) => { // If we opened a view in the sidebar, stop any restore there if (locationsRestored[ViewContainerLocation.Sidebar] != null) { - initialLayoutState.views.containerToRestore.sideBar = locationsRestored[ViewContainerLocation.Sidebar].id + initialLayoutState.views.containerToRestore.sideBar = + locationsRestored[ViewContainerLocation.Sidebar].id } // If we opened a view in the panel, stop any restore there if (locationsRestored[ViewContainerLocation.Panel] != null) { - initialLayoutState.views.containerToRestore.panel = locationsRestored[ViewContainerLocation.Panel].id + initialLayoutState.views.containerToRestore.panel = + locationsRestored[ViewContainerLocation.Panel].id } // If we opened a view in the auxiliary bar, stop any restore there if (locationsRestored[ViewContainerLocation.AuxiliaryBar] != null) { - initialLayoutState.views.containerToRestore.auxiliaryBar = locationsRestored[ViewContainerLocation.AuxiliaryBar].id + initialLayoutState.views.containerToRestore.auxiliaryBar = + locationsRestored[ViewContainerLocation.AuxiliaryBar].id } mark('code/didOpenDefaultViews') @@ -582,83 +708,123 @@ onRenderWorkbench(async (accessor) => { layoutReadyPromises.push(restoreDefaultViewsPromise) // Restore Sidebar - layoutReadyPromises.push((async () => { - // Restoring views could mean that sidebar already - // restored, as such we need to test again - await restoreDefaultViewsPromise - if (initialLayoutState.views.containerToRestore.sideBar == null) { - return - } - - mark('code/willRestoreViewlet') + layoutReadyPromises.push( + (async () => { + // Restoring views could mean that sidebar already + // restored, as such we need to test again + await restoreDefaultViewsPromise + if (initialLayoutState.views.containerToRestore.sideBar == null) { + return + } - const viewlet = await paneCompositePartService.openPaneComposite(initialLayoutState.views.containerToRestore.sideBar, ViewContainerLocation.Sidebar) - if (viewlet == null) { - await paneCompositePartService.openPaneComposite(getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id, ViewContainerLocation.Sidebar) // fallback to default viewlet as needed - } + mark('code/willRestoreViewlet') + + const viewlet = await paneCompositePartService.openPaneComposite( + initialLayoutState.views.containerToRestore.sideBar, + ViewContainerLocation.Sidebar + ) + if (viewlet == null) { + await paneCompositePartService.openPaneComposite( + getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id, + ViewContainerLocation.Sidebar + ) // fallback to default viewlet as needed + } - mark('code/didRestoreViewlet') - })()) + mark('code/didRestoreViewlet') + })() + ) // Restore Panel - layoutReadyPromises.push((async () => { - // Restoring views could mean that panel already - // restored, as such we need to test again - await restoreDefaultViewsPromise - if (initialLayoutState.views.containerToRestore.panel == null) { - return - } - - mark('code/willRestorePanel') + layoutReadyPromises.push( + (async () => { + // Restoring views could mean that panel already + // restored, as such we need to test again + await restoreDefaultViewsPromise + if (initialLayoutState.views.containerToRestore.panel == null) { + return + } - const panel = await paneCompositePartService.openPaneComposite(initialLayoutState.views.containerToRestore.panel, ViewContainerLocation.Panel) - if (panel == null) { - await paneCompositePartService.openPaneComposite(getDefaultViewContainer(ViewContainerLocation.Panel)?.id, ViewContainerLocation.Panel) // fallback to default panel as needed - } + mark('code/willRestorePanel') + + const panel = await paneCompositePartService.openPaneComposite( + initialLayoutState.views.containerToRestore.panel, + ViewContainerLocation.Panel + ) + if (panel == null) { + await paneCompositePartService.openPaneComposite( + getDefaultViewContainer(ViewContainerLocation.Panel)?.id, + ViewContainerLocation.Panel + ) // fallback to default panel as needed + } - mark('code/didRestorePanel') - })()) + mark('code/didRestorePanel') + })() + ) // Restore Auxiliary Bar - layoutReadyPromises.push((async () => { - // Restoring views could mean that panel already - // restored, as such we need to test again - await restoreDefaultViewsPromise - if (initialLayoutState.views.containerToRestore.auxiliaryBar == null) { - return - } - - mark('code/willRestoreAuxiliaryBar') + layoutReadyPromises.push( + (async () => { + // Restoring views could mean that panel already + // restored, as such we need to test again + await restoreDefaultViewsPromise + if (initialLayoutState.views.containerToRestore.auxiliaryBar == null) { + return + } - const panel = await paneCompositePartService.openPaneComposite(initialLayoutState.views.containerToRestore.auxiliaryBar, ViewContainerLocation.AuxiliaryBar) - if (panel == null) { - await paneCompositePartService.openPaneComposite(getDefaultViewContainer(ViewContainerLocation.AuxiliaryBar)?.id, ViewContainerLocation.AuxiliaryBar) // fallback to default panel as needed - } + mark('code/willRestoreAuxiliaryBar') + + const panel = await paneCompositePartService.openPaneComposite( + initialLayoutState.views.containerToRestore.auxiliaryBar, + ViewContainerLocation.AuxiliaryBar + ) + if (panel == null) { + await paneCompositePartService.openPaneComposite( + getDefaultViewContainer(ViewContainerLocation.AuxiliaryBar)?.id, + ViewContainerLocation.AuxiliaryBar + ) // fallback to default panel as needed + } - mark('code/didRestoreAuxiliaryBar') - })()) + mark('code/didRestoreAuxiliaryBar') + })() + ) await Promises.settled(layoutReadyPromises) await Promises.settled(layoutRestoredPromises) }) -function getServiceOverride (openEditorFallback?: OpenEditor, _webviewIframeAlternateDomains?: string): IEditorOverrideServices +function getServiceOverride( + openEditorFallback?: OpenEditor, + _webviewIframeAlternateDomains?: string +): IEditorOverrideServices /** * @deprecated Provide restoreEditors with the initializationState.editor.restoreEditors params */ -function getServiceOverride (openEditorFallback?: OpenEditor, _webviewIframeAlternateDomains?: string, restoreEditors?: boolean): IEditorOverrideServices -function getServiceOverride (openEditorFallback?: OpenEditor, _webviewIframeAlternateDomains?: string, initializationState?: InitializationStateTransformer): IEditorOverrideServices -function getServiceOverride (openEditorFallback?: OpenEditor, _webviewIframeAlternateDomains?: string, initializationStateOrRestoreEditors?: boolean | InitializationStateTransformer): IEditorOverrideServices { +function getServiceOverride( + openEditorFallback?: OpenEditor, + _webviewIframeAlternateDomains?: string, + restoreEditors?: boolean +): IEditorOverrideServices +function getServiceOverride( + openEditorFallback?: OpenEditor, + _webviewIframeAlternateDomains?: string, + initializationState?: InitializationStateTransformer +): IEditorOverrideServices +function getServiceOverride( + openEditorFallback?: OpenEditor, + _webviewIframeAlternateDomains?: string, + initializationStateOrRestoreEditors?: boolean | InitializationStateTransformer +): IEditorOverrideServices { if (initializationStateOrRestoreEditors != null) { - transformInitializationState = typeof initializationStateOrRestoreEditors === 'boolean' - ? (state: ILayoutInitializationState) => ({ - ...state, - editor: { - ...state.editor, - restoreEditors: initializationStateOrRestoreEditors - } - }) - : initializationStateOrRestoreEditors + transformInitializationState = + typeof initializationStateOrRestoreEditors === 'boolean' + ? (state: ILayoutInitializationState) => ({ + ...state, + editor: { + ...state.editor, + restoreEditors: initializationStateOrRestoreEditors + } + }) + : initializationStateOrRestoreEditors } return { @@ -671,7 +837,11 @@ function getServiceOverride (openEditorFallback?: OpenEditor, _webviewIframeAlte shouldUseGlobalKeybindings: isEditorPartVisible }), [IEditorGroupsService.toString()]: new SyncDescriptor(MonacoEditorParts, [], false), - [IEditorService.toString()]: new SyncDescriptor(MonacoEditorService, [openEditorFallback, isEditorPartVisible], false) + [IEditorService.toString()]: new SyncDescriptor( + MonacoEditorService, + [openEditorFallback, isEditorPartVisible], + false + ) } } @@ -681,7 +851,6 @@ export { ILayoutInitializationState, InitializationStateTransformer, GroupOrientation, - renderPart, renderSidebarPart, renderActivitybarPar, @@ -693,12 +862,10 @@ export { attachPart, onPartVisibilityChange, Position, - OpenEditor, IEditorOptions, IResolvedTextEditorModel, IReference, - ActivityService, SidebarPart, ActivitybarPart, diff --git a/src/service-override/walkthrough.ts b/src/service-override/walkthrough.ts index 7db2954b..ef691d16 100644 --- a/src/service-override/walkthrough.ts +++ b/src/service-override/walkthrough.ts @@ -11,7 +11,7 @@ import { registerAssets } from '../assets' registerAssets(svgAssets) registerAssets(pngAssets) -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IWalkthroughsService.toString()]: new SyncDescriptor(WalkthroughsService, [], true) } diff --git a/src/service-override/welcome.ts b/src/service-override/welcome.ts index 4dd52fe5..7290353a 100644 --- a/src/service-override/welcome.ts +++ b/src/service-override/welcome.ts @@ -2,7 +2,6 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standalone import 'vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution' import 'vs/workbench/contrib/welcomeViews/common/newFile.contribution' -export default function getServiceOverride (): IEditorOverrideServices { - return { - } +export default function getServiceOverride(): IEditorOverrideServices { + return {} } diff --git a/src/service-override/workbench.ts b/src/service-override/workbench.ts index 57a13ef9..819c0fd7 100644 --- a/src/service-override/workbench.ts +++ b/src/service-override/workbench.ts @@ -25,7 +25,7 @@ import { onLayout, onRenderWorkbench } from '../lifecycle' export * from './tools/views' class CustomWorkbench extends Workbench { - constructor ( + constructor( options: IWorkbenchOptions | undefined, @ILogService logService: ILogService, @IInstantiationService private instantiationService: IInstantiationService @@ -35,19 +35,19 @@ class CustomWorkbench extends Workbench { this.mainContainer.classList.add('monaco-workbench-part') } - protected override registerErrorHandler (): void { + protected override registerErrorHandler(): void { // prevent intercepting global error events } - override createNotificationsHandlers () { + override createNotificationsHandlers() { // nothing, it's done in the notification service override } - protected override initServices (): IInstantiationService { + protected override initServices(): IInstantiationService { return this.instantiationService } - override restore (): void { + override restore(): void { try { this.restoreParts() } catch (error) { @@ -60,14 +60,17 @@ class CustomWorkbench extends Workbench { const detectedFullScreen = detectFullscreen(mainWindow) setFullscreen(detectedFullScreen != null && !detectedFullScreen.guess, mainWindow) -onLayout(async accessor => { - (accessor.get(IWorkbenchLayoutService) as Workbench).startup() +onLayout(async (accessor) => { + ;(accessor.get(IWorkbenchLayoutService) as Workbench).startup() }) -onRenderWorkbench(async accessor => { +onRenderWorkbench(async (accessor) => { accessor.get(IInstantiationService).createInstance(BrowserWindow) }) -function getServiceOverride (options?: IWorkbenchOptions, _webviewIframeAlternateDomains?: string): IEditorOverrideServices { +function getServiceOverride( + options?: IWorkbenchOptions, + _webviewIframeAlternateDomains?: string +): IEditorOverrideServices { return { ...getViewCommonServiceOverride(_webviewIframeAlternateDomains), ...getQuickAccessOverride({ diff --git a/src/service-override/workingCopy.ts b/src/service-override/workingCopy.ts index 429d0571..bef9f57d 100644 --- a/src/service-override/workingCopy.ts +++ b/src/service-override/workingCopy.ts @@ -16,7 +16,7 @@ import { WorkingCopyBackupService } from 'vs/workbench/services/workingCopy/comm import getFileServiceOverride from './files' class BrowserWorkingCopyBackupService extends WorkingCopyBackupService { - constructor ( + constructor( memory: boolean, @IWorkspaceContextService contextService: IWorkspaceContextService, @IWorkbenchEnvironmentService environmentService: IWorkbenchEnvironmentService, @@ -24,7 +24,13 @@ class BrowserWorkingCopyBackupService extends WorkingCopyBackupService { @ILogService logService: ILogService ) { super( - memory ? undefined : joinPath(environmentService.userRoamingDataHome, 'Backups', contextService.getWorkspace().id), + memory + ? undefined + : joinPath( + environmentService.userRoamingDataHome, + 'Backups', + contextService.getWorkspace().id + ), fileService, logService ) @@ -35,17 +41,26 @@ interface WorkingCopyServiceOptions { storage?: 'memory' | 'userData' | null } -export default function getServiceOverride ({ storage = 'userData' }: WorkingCopyServiceOptions = {}): IEditorOverrideServices { +export default function getServiceOverride({ + storage = 'userData' +}: WorkingCopyServiceOptions = {}): IEditorOverrideServices { return { ...getFileServiceOverride(), ...(storage != null ? { - [IWorkingCopyBackupService.toString()]: new SyncDescriptor(BrowserWorkingCopyBackupService, [storage === 'memory'], false) + [IWorkingCopyBackupService.toString()]: new SyncDescriptor( + BrowserWorkingCopyBackupService, + [storage === 'memory'], + false + ) } : {}), [IWorkingCopyService.toString()]: new SyncDescriptor(WorkingCopyService, [], false), [IWorkingCopyEditorService.toString()]: new SyncDescriptor(WorkingCopyEditorService, [], false), - [IWorkingCopyHistoryService.toString()]: new SyncDescriptor(BrowserWorkingCopyHistoryService, [], false) - + [IWorkingCopyHistoryService.toString()]: new SyncDescriptor( + BrowserWorkingCopyHistoryService, + [], + false + ) } } diff --git a/src/service-override/workspaceTrust.ts b/src/service-override/workspaceTrust.ts index e7df0228..ccaa0918 100644 --- a/src/service-override/workspaceTrust.ts +++ b/src/service-override/workspaceTrust.ts @@ -1,13 +1,25 @@ import { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IWorkspaceTrustEnablementService, IWorkspaceTrustManagementService, IWorkspaceTrustRequestService } from 'vs/platform/workspace/common/workspaceTrust.service' -import { WorkspaceTrustEnablementService, WorkspaceTrustManagementService, WorkspaceTrustRequestService } from 'vs/workbench/services/workspaces/common/workspaceTrust' +import { + IWorkspaceTrustEnablementService, + IWorkspaceTrustManagementService, + IWorkspaceTrustRequestService +} from 'vs/platform/workspace/common/workspaceTrust.service' +import { + WorkspaceTrustEnablementService, + WorkspaceTrustManagementService, + WorkspaceTrustRequestService +} from 'vs/workbench/services/workspaces/common/workspaceTrust' import 'vs/workbench/contrib/workspace/browser/workspace.contribution' -export default function getServiceOverride (): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { - [IWorkspaceTrustEnablementService.toString()]: new SyncDescriptor(WorkspaceTrustEnablementService), - [IWorkspaceTrustManagementService.toString()]: new SyncDescriptor(WorkspaceTrustManagementService), + [IWorkspaceTrustEnablementService.toString()]: new SyncDescriptor( + WorkspaceTrustEnablementService + ), + [IWorkspaceTrustManagementService.toString()]: new SyncDescriptor( + WorkspaceTrustManagementService + ), [IWorkspaceTrustRequestService.toString()]: new SyncDescriptor(WorkspaceTrustRequestService) } } diff --git a/src/services.ts b/src/services.ts index 2583b041..e6184e95 100644 --- a/src/services.ts +++ b/src/services.ts @@ -5,19 +5,41 @@ import 'vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard' import Severity from 'vs/base/common/severity' import { ITextModelContentProvider } from 'vs/editor/common/services/resolverService' import { StorageScope, StorageTarget } from 'vs/platform/storage/common/storage' -import { IEditorOverrideServices, StandaloneServices } from 'vs/editor/standalone/browser/standaloneServices' +import { + IEditorOverrideServices, + StandaloneServices +} from 'vs/editor/standalone/browser/standaloneServices' import { mixin } from 'vs/base/common/objects' -import { GetLeadingNonServiceArgs, IInstantiationService, ServiceIdentifier, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' +import { + GetLeadingNonServiceArgs, + IInstantiationService, + ServiceIdentifier, + ServicesAccessor +} from 'vs/platform/instantiation/common/instantiation' import { IAction } from 'vs/base/common/actions' import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle' import { IWorkbenchConstructionOptions } from 'vs/workbench/browser/web.api' import { IProductConfiguration } from 'vs/base/common/product' -import { ILazyWorkbenchContributionInstantiation, IOnEditorWorkbenchContributionInstantiation, IWorkbenchContribution, WorkbenchContributionInstantiation, WorkbenchPhase, registerWorkbenchContribution2 } from 'vs/workbench/common/contributions' +import { + ILazyWorkbenchContributionInstantiation, + IOnEditorWorkbenchContributionInstantiation, + IWorkbenchContribution, + WorkbenchContributionInstantiation, + WorkbenchPhase, + registerWorkbenchContribution2 +} from 'vs/workbench/common/contributions' import { IProductService } from 'vs/platform/product/common/productService.service' import { IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration' import { IColorTheme } from 'vs/platform/theme/common/themeService' import { EnvironmentOverride, initialize as initializeWorkbench } from './workbench' -import { checkServicesNotInitialized, checkServicesReady, serviceInitializedBarrier, serviceInitializedEmitter, startup, waitServicesReady } from './lifecycle' +import { + checkServicesNotInitialized, + checkServicesReady, + serviceInitializedBarrier, + serviceInitializedEmitter, + startup, + waitServicesReady +} from './lifecycle' import getQuickAccessOverride from './service-override/quickaccess' import getFileServiceOverride from './service-override/files' import getExtensionsServiceOverride from './service-override/extensions' @@ -26,26 +48,34 @@ import getLayoutServiceOverride from './service-override/layout' import getHostServiceOverride from './service-override/host' import getBaseServiceOverride from './service-override/base' -export async function initialize (overrides: IEditorOverrideServices, container: HTMLElement = document.body, configuration: IWorkbenchConstructionOptions = {}, env?: EnvironmentOverride): Promise { +export async function initialize( + overrides: IEditorOverrideServices, + container: HTMLElement = document.body, + configuration: IWorkbenchConstructionOptions = {}, + env?: EnvironmentOverride +): Promise { checkServicesNotInitialized() initializeWorkbench(container, configuration, env) const instantiationService = StandaloneServices.initialize({ - [IProductService.toString()]: mixin(>{ - version: VSCODE_VERSION, - quality: 'stable', - commit: VSCODE_COMMIT, - nameShort: 'Code - OSS', - nameLong: 'Code - OSS', - applicationName: 'code-oss', - dataFolderName: '.vscode-oss', - urlProtocol: 'code-oss', - reportIssueUrl: 'https://github.com/microsoft/vscode/issues/new', - licenseName: 'MIT', - licenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt', - serverApplicationName: 'code-server-oss' - }, configuration.productConfiguration ?? {}), + [IProductService.toString()]: mixin( + >{ + version: VSCODE_VERSION, + quality: 'stable', + commit: VSCODE_COMMIT, + nameShort: 'Code - OSS', + nameLong: 'Code - OSS', + applicationName: 'code-oss', + dataFolderName: '.vscode-oss', + urlProtocol: 'code-oss', + reportIssueUrl: 'https://github.com/microsoft/vscode/issues/new', + licenseName: 'MIT', + licenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt', + serverApplicationName: 'code-server-oss' + }, + configuration.productConfiguration ?? {} + ), ...getLayoutServiceOverride(), // Always override layout service to break cyclic dependency with ICodeEditorService ...getEnvironmentServiceOverride(), ...getExtensionsServiceOverride(), @@ -59,19 +89,25 @@ export async function initialize (overrides: IEditorOverrideServices, container: await startup(instantiationService) } -export async function getService (identifier: ServiceIdentifier): Promise { +export async function getService(identifier: ServiceIdentifier): Promise { await waitServicesReady() return StandaloneServices.get(identifier) } -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export async function createInstance any, R extends InstanceType>(ctor: Ctor, ...args: GetLeadingNonServiceArgs>): Promise { +export async function createInstance< + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Ctor extends new (...args: any[]) => any, + R extends InstanceType +>(ctor: Ctor, ...args: GetLeadingNonServiceArgs>): Promise { await waitServicesReady() return StandaloneServices.get(IInstantiationService).createInstance(ctor, ...args) } -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function createInstanceSync any, R extends InstanceType>(ctor: Ctor, ...args: GetLeadingNonServiceArgs>): R { +export function createInstanceSync< + // eslint-disable-next-line @typescript-eslint/no-explicit-any + Ctor extends new (...args: any[]) => any, + R extends InstanceType +>(ctor: Ctor, ...args: GetLeadingNonServiceArgs>): R { checkServicesReady() return StandaloneServices.get(IInstantiationService).createInstance(ctor, ...args) } @@ -79,24 +115,32 @@ export function createInstanceSync any, R /** * Equivalent to `StandaloneServices.withServices` except the callback is called when the services are ready, not just initialized */ -export function withReadyServices (callback: (serviceAccessor: ServicesAccessor) => IDisposable): IDisposable { +export function withReadyServices( + callback: (serviceAccessor: ServicesAccessor) => IDisposable +): IDisposable { if (serviceInitializedBarrier.isOpen()) { return StandaloneServices.get(IInstantiationService).invokeFunction(callback) } const disposable = new DisposableStore() - const listener = disposable.add(serviceInitializedEmitter.event(() => { - listener.dispose() - disposable.add(StandaloneServices.get(IInstantiationService).invokeFunction(callback)) - })) + const listener = disposable.add( + serviceInitializedEmitter.event(() => { + listener.dispose() + disposable.add(StandaloneServices.get(IInstantiationService).invokeFunction(callback)) + }) + ) return disposable } -export const registerWorkbenchContribution = (id: string, contribution: (accessor: ServicesAccessor) => void, instantiation: WorkbenchContributionInstantiation): void => { +export const registerWorkbenchContribution = ( + id: string, + contribution: (accessor: ServicesAccessor) => void, + instantiation: WorkbenchContributionInstantiation +): void => { class Contribution implements IWorkbenchContribution { - constructor (@IInstantiationService instantiationService: IInstantiationService) { + constructor(@IInstantiationService instantiationService: IInstantiationService) { instantiationService.invokeFunction(contribution) } } @@ -128,9 +172,7 @@ export { IQuickInputService } from 'vs/platform/quickinput/common/quickInput.ser export { ITelemetryService } from 'vs/platform/telemetry/common/telemetry.service' export { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity.service' export { IBreadcrumbsService } from 'vs/workbench/browser/parts/editor/breadcrumbs.service' -export { - IEditorGroupsService -} from 'vs/workbench/services/editor/common/editorGroupsService.service' +export { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' export { IEditorGroup, GroupDirection, @@ -168,7 +210,11 @@ export { IEditorControl } from 'vs/workbench/common/editor' export { IDimension } from 'vs/editor/common/core/dimension' -export { IEditorOptions, ITextEditorOptions, IResourceEditorInput } from 'vs/platform/editor/common/editor' +export { + IEditorOptions, + ITextEditorOptions, + IResourceEditorInput +} from 'vs/platform/editor/common/editor' export { EditorInput } from 'vs/workbench/common/editor/editorInput' export { IGroupModelChangeEvent } from 'vs/workbench/common/editor/editorGroupModel' export { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' @@ -211,10 +257,7 @@ export { ILanguagePackService } from 'vs/platform/languagePacks/common/languageP export { ILocaleService } from 'vs/workbench/services/localization/common/locale.service' // Export all Notification service parts -export { - NoOpNotification, - NoOpProgress -} from 'vs/platform/notification/common/notification' +export { NoOpNotification, NoOpProgress } from 'vs/platform/notification/common/notification' export { NotificationsFilter, NotificationMessage, @@ -271,7 +314,11 @@ export { IExplorerService } from 'vs/workbench/contrib/files/browser/files.servi export { IStatusbarService } from 'vs/workbench/services/statusbar/browser/statusbar.service' export { ITitleService } from 'vs/workbench/services/title/browser/titleService.service' export { IBannerService } from 'vs/workbench/services/banner/browser/bannerService.service' -export { IWorkspaceTrustManagementService, IWorkspaceTrustRequestService, IWorkspaceTrustEnablementService } from 'vs/platform/workspace/common/workspaceTrust.service' +export { + IWorkspaceTrustManagementService, + IWorkspaceTrustRequestService, + IWorkspaceTrustEnablementService +} from 'vs/platform/workspace/common/workspaceTrust.service' export { IWorkspaceTrustUriInfo } from 'vs/platform/workspace/common/workspaceTrust' export { IKeybindingService } from 'vs/platform/keybinding/common/keybinding.service' export { ISecretStorageService } from 'vs/platform/secrets/common/secrets.service' diff --git a/src/tools.ts b/src/tools.ts index b3c2eb0d..64a40add 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -1,10 +1,10 @@ -export function unsupported (): never { +export function unsupported(): never { throw new Error('unsupported') } export const noop = (): void => {} -export function memoized (fct: (...args: A) => T): (...args: A) => T { +export function memoized(fct: (...args: A) => T): (...args: A) => T { let v: T | null = null return (...args) => { if (v == null) { @@ -14,7 +14,7 @@ export function memoized (fct: (...args: A) => T): (...a } } -export function memoizedConstructor (ctor: new (...args: any[]) => T): new (...args: any[]) => T { +export function memoizedConstructor(ctor: new (...args: any[]) => T): new (...args: any[]) => T { return new Proxy(ctor, { construct: memoized((target, args) => { return Reflect.construct(ctor, args) as object @@ -22,22 +22,28 @@ export function memoizedConstructor (ctor: new (...args: any[]) => T): new (. }) } -export async function sleep (duration: number): Promise { - await new Promise(resolve => setTimeout(resolve, duration)) +export async function sleep(duration: number): Promise { + await new Promise((resolve) => setTimeout(resolve, duration)) } -export function throttle (fct: (param: T) => Promise, merge: (a: T, b: T) => T, delay: number): (param: T) => Promise { +export function throttle( + fct: (param: T) => Promise, + merge: (a: T, b: T) => T, + delay: number +): (param: T) => Promise { let lastPromise: Promise = Promise.resolve() let toConsume: T | null = null return async (param: T) => { if (toConsume == null) { toConsume = param - lastPromise = lastPromise.then(async () => await sleep(delay)).then(async () => { - const _toConsume = toConsume! - toConsume = null - await fct(_toConsume) - }) + lastPromise = lastPromise + .then(async () => await sleep(delay)) + .then(async () => { + const _toConsume = toConsume! + toConsume = null + await fct(_toConsume) + }) } else { toConsume = merge(toConsume, param) } diff --git a/src/tools/injection.ts b/src/tools/injection.ts index 1c74cded..e12c4d67 100644 --- a/src/tools/injection.ts +++ b/src/tools/injection.ts @@ -1,23 +1,46 @@ -import { BrandedService, IInstantiationService, _util } from 'vs/platform/instantiation/common/instantiation' +import { + BrandedService, + IInstantiationService, + _util +} from 'vs/platform/instantiation/common/instantiation' -function getInjectedParameters InstanceType> (instantiationService: IInstantiationService, ctor: Ctor) { +function getInjectedParameters InstanceType>( + instantiationService: IInstantiationService, + ctor: Ctor +) { return instantiationService.invokeFunction((accessor) => { - return _util.getServiceDependencies(ctor).sort((a, b) => a.index - b.index).map(d => accessor.get(d.id)) + return _util + .getServiceDependencies(ctor) + .sort((a, b) => a.index - b.index) + .map((d) => accessor.get(d.id)) }) } -declare type GetLeadingNonServiceArgs = Args extends [...BrandedService[]] ? [] : Args extends [infer A, ...BrandedService[]] ? [A] : Args extends [infer A, ...infer R] ? [A, ...GetLeadingNonServiceArgs] : never +declare type GetLeadingNonServiceArgs = Args extends [...BrandedService[]] + ? [] + : Args extends [infer A, ...BrandedService[]] + ? [A] + : Args extends [infer A, ...infer R] + ? [A, ...GetLeadingNonServiceArgs] + : never /** * Takes a class with injected services as parameters and returns a child class that only takes the injector as parameter * @param ctor The class to inject * @returns A class that only needs the injector */ -export function createInjectedClass InstanceType>(ctor: Ctor): new (instantiationService: IInstantiationService, ...args: GetLeadingNonServiceArgs>) => InstanceType { +export function createInjectedClass< + Ctor extends abstract new (...args: any[]) => InstanceType +>( + ctor: Ctor +): new ( + instantiationService: IInstantiationService, + ...args: GetLeadingNonServiceArgs> +) => InstanceType { // eslint-disable-next-line @typescript-eslint/no-explicit-any - const _ctor = (ctor as (abstract new (...args: any[]) => any)) + const _ctor = ctor as abstract new (...args: any[]) => any return class extends _ctor { - constructor (...args: any[]) { + constructor(...args: any[]) { super(...args.slice(1), ...getInjectedParameters(args[0], ctor)) } // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/workbench.ts b/src/workbench.ts index 7d29779c..1fa13eaf 100644 --- a/src/workbench.ts +++ b/src/workbench.ts @@ -1,7 +1,13 @@ -import { IAnyWorkspaceIdentifier, UNKNOWN_EMPTY_WINDOW_WORKSPACE } from 'vs/platform/workspace/common/workspace' +import { + IAnyWorkspaceIdentifier, + UNKNOWN_EMPTY_WINDOW_WORKSPACE +} from 'vs/platform/workspace/common/workspace' import { IWorkbenchConstructionOptions, IWorkspace } from 'vs/workbench/browser/web.api' import { isFolderToOpen, isWorkspaceToOpen } from 'vs/platform/window/common/window' -import { getSingleFolderWorkspaceIdentifier, getWorkspaceIdentifier as getWorkspaceIdentifierFromUri } from 'vs/workbench/services/workspaces/browser/workspaces' +import { + getSingleFolderWorkspaceIdentifier, + getWorkspaceIdentifier as getWorkspaceIdentifierFromUri +} from 'vs/workbench/services/workspaces/browser/workspaces' import { URI } from 'vs/base/common/uri' import { toLocalISOString } from 'vs/base/common/date' @@ -13,25 +19,27 @@ let workbenchContainer: HTMLElement = document.body let workbenchConstructionOptions: IWorkbenchConstructionOptions = {} let environmentOverride: EnvironmentOverride = {} let workspaceIdentifier: IAnyWorkspaceIdentifier = UNKNOWN_EMPTY_WINDOW_WORKSPACE -export const logsPath = URI.file(toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, '')).with({ scheme: 'vscode-log' }) +export const logsPath = URI.file(toLocalISOString(new Date()).replace(/-|:|\.\d+Z$/g, '')).with({ + scheme: 'vscode-log' +}) -export function getWorkbenchContainer (): HTMLElement { +export function getWorkbenchContainer(): HTMLElement { return workbenchContainer } -export function getWorkbenchConstructionOptions (): IWorkbenchConstructionOptions { +export function getWorkbenchConstructionOptions(): IWorkbenchConstructionOptions { return workbenchConstructionOptions } -export function getEnvironmentOverride (): EnvironmentOverride { +export function getEnvironmentOverride(): EnvironmentOverride { return environmentOverride } -export function getWorkspaceIdentifier (): IAnyWorkspaceIdentifier { +export function getWorkspaceIdentifier(): IAnyWorkspaceIdentifier { return workspaceIdentifier } -function resolveWorkspace (configuration: IWorkbenchConstructionOptions): IAnyWorkspaceIdentifier { +function resolveWorkspace(configuration: IWorkbenchConstructionOptions): IAnyWorkspaceIdentifier { let workspace: IWorkspace | undefined if (configuration.workspaceProvider != null) { workspace = configuration.workspaceProvider.workspace @@ -51,7 +59,11 @@ function resolveWorkspace (configuration: IWorkbenchConstructionOptions): IAnyWo return UNKNOWN_EMPTY_WINDOW_WORKSPACE } -export function initialize (container: HTMLElement, options: IWorkbenchConstructionOptions, env: EnvironmentOverride = {}): void { +export function initialize( + container: HTMLElement, + options: IWorkbenchConstructionOptions, + env: EnvironmentOverride = {} +): void { workbenchContainer = container workbenchConstructionOptions = options environmentOverride = env From 7946aa539752e53ebcce7f7167e17b398024f40b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 7 Oct 2024 18:58:27 +0200 Subject: [PATCH 7/7] fix: fix demo build --- demo/vite.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/demo/vite.config.ts b/demo/vite.config.ts index 00e60b76..c95d36eb 100644 --- a/demo/vite.config.ts +++ b/demo/vite.config.ts @@ -11,6 +11,9 @@ export default defineConfig({ build: { target: 'esnext' }, + worker: { + format: 'es' + }, plugins: [ { // For the *-language-features extensions which use SharedArrayBuffer